mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Feature / Streamer Mode (#159)
* feat(phone/settings): Add streamer mode setting and PictureReveal component :) * feat(phone/settings): Add PictureReveal streamer mode to twitter and improve its theme a bit
This commit is contained in:
1 parent
d841ee0958
commit
75a4eb176e
27 files changed
+174
-91
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React from 'react';
|
||||||
import './Phone.css';
|
import './Phone.css';
|
||||||
import './i18n';
|
import './i18n';
|
||||||
import { Route } from 'react-router-dom';
|
import { Route } from 'react-router-dom';
|
||||||
|
|||||||
@@ -130,6 +130,19 @@ InjectDebugData(
|
|||||||
isMine: false,
|
isMine: false,
|
||||||
updatedAt: Date.now(),
|
updatedAt: Date.now(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
message:
|
||||||
|
'https://upload.wikimedia.org/wikipedia/commons/thumb/3/31/Hadena_albimacula.jpg/800px-Hadena_albimacula.jpg',
|
||||||
|
user_identifier: '123',
|
||||||
|
phone_number: '444-4444',
|
||||||
|
display: 'kidz',
|
||||||
|
avatar: null,
|
||||||
|
groupId: '2',
|
||||||
|
isRead: true,
|
||||||
|
isMine: false,
|
||||||
|
updatedAt: Date.now(),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { Box, Link, makeStyles, Paper, Typography } from '@material-ui/core';
|
import { Box, Link, makeStyles, Paper, Typography } from '@material-ui/core';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Message } from '../../../../common/typings/messages';
|
import { Message } from '../../../../common/typings/messages';
|
||||||
|
import { PictureResponsive } from '../../../../ui/components/PictureResponsive';
|
||||||
|
import { PictureReveal } from '../../../../ui/components/PictureReveal';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -8,12 +10,6 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
marginTop: 'auto',
|
marginTop: 'auto',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
imageMessage: {
|
|
||||||
width: '80%',
|
|
||||||
maxWidth: '80%',
|
|
||||||
height: '80%',
|
|
||||||
maxHeight: '80%',
|
|
||||||
},
|
|
||||||
mySms: {
|
mySms: {
|
||||||
float: 'right',
|
float: 'right',
|
||||||
margin: theme.spacing(1),
|
margin: theme.spacing(1),
|
||||||
@@ -64,7 +60,9 @@ export const MessageBubble = ({
|
|||||||
<Paper className={message.isMine ? classes.mySms : classes.sms} variant="outlined">
|
<Paper className={message.isMine ? classes.mySms : classes.sms} variant="outlined">
|
||||||
<Box className={classes.message}>
|
<Box className={classes.message}>
|
||||||
{isImage(message.message) ? (
|
{isImage(message.message) ? (
|
||||||
<img src={message.message} className={classes.imageMessage} alt="multimedia" />
|
<PictureReveal>
|
||||||
|
<PictureResponsive src={message.message} alt="message multimedia" />
|
||||||
|
</PictureReveal>
|
||||||
) : (
|
) : (
|
||||||
<div>{message.message}</div>
|
<div>{message.message}</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { ListItem } from '../../../../ui/components/ListItem';
|
|||||||
import { PictureResponsive } from '../../../../ui/components/PictureResponsive';
|
import { PictureResponsive } from '../../../../ui/components/PictureResponsive';
|
||||||
import { MarketplaceListing } from '../../../../common/typings/marketplace';
|
import { MarketplaceListing } from '../../../../common/typings/marketplace';
|
||||||
import { ListingActions } from './ListingActions';
|
import { ListingActions } from './ListingActions';
|
||||||
|
import { PictureReveal } from '../../../../ui/components/PictureReveal';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -49,7 +50,9 @@ export const SelloutItem = (listing: MarketplaceListing) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{listing.url ? (
|
{listing.url ? (
|
||||||
<PictureResponsive src={listing.url} alt={`${listing.name}`} />
|
<PictureReveal>
|
||||||
|
<PictureResponsive src={listing.url} alt={`${listing.name}`} />
|
||||||
|
</PictureReveal>
|
||||||
) : (
|
) : (
|
||||||
<Typography style={{ margin: 10 }}>
|
<Typography style={{ margin: 10 }}>
|
||||||
No image provided{' '}
|
No image provided{' '}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
IconButton,
|
IconButton,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
Typography,
|
Typography,
|
||||||
|
Switch,
|
||||||
} from '@material-ui/core';
|
} from '@material-ui/core';
|
||||||
|
|
||||||
interface ISettingItem {
|
interface ISettingItem {
|
||||||
@@ -61,6 +62,23 @@ interface ISettingItemIconAction {
|
|||||||
actionLabel: string;
|
actionLabel: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ISettingSwitch {
|
||||||
|
label: string;
|
||||||
|
value: boolean;
|
||||||
|
onClick: any;
|
||||||
|
icon: JSX.Element;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const SettingSwitch = ({ label, value, onClick, icon }: ISettingSwitch) => (
|
||||||
|
<ListItem divider button>
|
||||||
|
<ListItemIcon>{icon}</ListItemIcon>
|
||||||
|
<ListItemText primary={label} />
|
||||||
|
<ListItemSecondaryAction>
|
||||||
|
<Switch color="primary" checked={value} onChange={() => onClick(value)} />
|
||||||
|
</ListItemSecondaryAction>
|
||||||
|
</ListItem>
|
||||||
|
);
|
||||||
|
|
||||||
export const SettingItemIconAction = ({
|
export const SettingItemIconAction = ({
|
||||||
icon,
|
icon,
|
||||||
label,
|
label,
|
||||||
|
|||||||
@@ -7,9 +7,14 @@ import { useConfig } from '../../../config/hooks/useConfig';
|
|||||||
import { List } from '../../../ui/components/List';
|
import { List } from '../../../ui/components/List';
|
||||||
import { useSimcard } from '../../../os/simcard/hooks/useSimcard';
|
import { useSimcard } from '../../../os/simcard/hooks/useSimcard';
|
||||||
import { useApp } from '../../../os/apps/hooks/useApps';
|
import { useApp } from '../../../os/apps/hooks/useApps';
|
||||||
import { SettingItem, SettingItemIconAction, SettingItemSlider } from './SettingItem';
|
import {
|
||||||
|
SettingItem,
|
||||||
|
SettingItemIconAction,
|
||||||
|
SettingItemSlider,
|
||||||
|
SettingSwitch,
|
||||||
|
} from './SettingItem';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import VisibilityOffIcon from '@material-ui/icons/VisibilityOff';
|
||||||
import {
|
import {
|
||||||
FilterList,
|
FilterList,
|
||||||
Brush,
|
Brush,
|
||||||
@@ -133,6 +138,12 @@ export const SettingsApp = () => {
|
|||||||
value={settings.notiSoundVol}
|
value={settings.notiSoundVol}
|
||||||
onCommit={(e, val) => handleSettingChange('notiSoundVol', val)}
|
onCommit={(e, val) => handleSettingChange('notiSoundVol', val)}
|
||||||
/>
|
/>
|
||||||
|
<SettingSwitch
|
||||||
|
label={t('APPS_SETTINGS_OPTION_STREAMER_MODE')}
|
||||||
|
icon={<VisibilityOffIcon />}
|
||||||
|
value={settings.streamerMode}
|
||||||
|
onClick={(curr) => handleSettingChange('streamerMode', !curr)}
|
||||||
|
/>
|
||||||
</List>
|
</List>
|
||||||
<List disablePadding subheader={<SubHeaderComp text="Appearance" />}>
|
<List disablePadding subheader={<SubHeaderComp text="Appearance" />}>
|
||||||
<SettingItem
|
<SettingItem
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export interface IPhoneSettings {
|
|||||||
frame: SettingOption;
|
frame: SettingOption;
|
||||||
theme: SettingOption;
|
theme: SettingOption;
|
||||||
zoom: SettingOption;
|
zoom: SettingOption;
|
||||||
|
streamerMode: boolean;
|
||||||
ringtone: SettingOption;
|
ringtone: SettingOption;
|
||||||
ringtoneVol: number;
|
ringtoneVol: number;
|
||||||
notiSound: SettingOption;
|
notiSound: SettingOption;
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
import React, { memo } from 'react';
|
import React, { memo } from 'react';
|
||||||
import { Picker } from 'emoji-mart';
|
import { Picker } from 'emoji-mart';
|
||||||
|
import { useTheme } from '@material-ui/core';
|
||||||
|
|
||||||
export const EmojiSelect = ({ visible, onEmojiClick }) => {
|
export const EmojiSelect = ({ visible, onEmojiClick }) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
if (!visible) return null;
|
if (!visible) return null;
|
||||||
|
|
||||||
return <Picker onClick={onEmojiClick} set="google" theme="dark" showPreview={false} />;
|
return (
|
||||||
|
<Picker onClick={onEmojiClick} set="google" theme={theme.palette.type} showPreview={false} />
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default memo(EmojiSelect); // The picker is an expensive render
|
export default memo(EmojiSelect); // The picker is an expensive render
|
||||||
@@ -43,7 +43,6 @@ export const TwitterApp = () => {
|
|||||||
const { profile } = useProfile();
|
const { profile } = useProfile();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
||||||
// this is a polling implementation. It is possible that
|
// this is a polling implementation. It is possible that
|
||||||
// there is some interaction where, on a new tweet, all
|
// there is some interaction where, on a new tweet, all
|
||||||
// clients are sent the updated query data. Until that can
|
// clients are sent the updated query data. Until that can
|
||||||
@@ -113,6 +112,7 @@ InjectDebugData([
|
|||||||
avatar_url: 'http://i.tasoagc.dev/jtKL',
|
avatar_url: 'http://i.tasoagc.dev/jtKL',
|
||||||
seconds_since_tweet: 500,
|
seconds_since_tweet: 500,
|
||||||
isMine: false,
|
isMine: false,
|
||||||
|
isRetweetedByPlayer: true,
|
||||||
updateAt: '2021-02-08 14:37:46',
|
updateAt: '2021-02-08 14:37:46',
|
||||||
visible: 1,
|
visible: 1,
|
||||||
likes: 50000,
|
likes: 50000,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import { Button } from '@material-ui/core';
|
import { Button } from '@material-ui/core';
|
||||||
|
import { StatusButton } from '../../../../ui/components/StatusButton';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
buttons: {
|
buttons: {
|
||||||
@@ -32,14 +33,14 @@ export const ControlButtons = ({ showImagePrompt, showEmoji, onCloseClick, onPri
|
|||||||
{primaryButtonText}
|
{primaryButtonText}
|
||||||
</Button>
|
</Button>
|
||||||
{showCloseButton && (
|
{showCloseButton && (
|
||||||
<Button
|
<StatusButton
|
||||||
className={classes.close}
|
className={classes.close}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="secondary"
|
color="error"
|
||||||
onClick={onCloseClick}
|
onClick={onCloseClick}
|
||||||
>
|
>
|
||||||
{t('APPS_TWITTER_CLOSE_IMAGE')}
|
{t('APPS_TWITTER_CLOSE_IMAGE')}
|
||||||
</Button>
|
</StatusButton>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -28,7 +28,11 @@ function LikeButton({ tweetId, isLiked }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return <Button onClick={handleClick}>{liked ? <FavoriteIcon /> : <FavoriteBorderIcon />}</Button>;
|
return (
|
||||||
|
<Button onClick={handleClick}>
|
||||||
|
{liked ? <FavoriteIcon color="primary" /> : <FavoriteBorderIcon />}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LikeButton;
|
export default LikeButton;
|
||||||
@@ -2,8 +2,6 @@ import React, { useState } from 'react';
|
|||||||
import { CircularProgress, makeStyles, Button } from '@material-ui/core';
|
import { CircularProgress, makeStyles, Button } from '@material-ui/core';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { faRetweet } from '@fortawesome/free-solid-svg-icons';
|
import { faRetweet } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
import { ITwitterTheme } from '../../twitter.theme';
|
|
||||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
@@ -12,11 +10,10 @@ interface IProps {
|
|||||||
isRetweet: boolean | number;
|
isRetweet: boolean | number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: ITwitterTheme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
icon: {}, // no styles on default icon
|
|
||||||
iconFilled: {
|
iconFilled: {
|
||||||
color: theme.palette.twitter.main,
|
color: theme.palette.primary.main,
|
||||||
}
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const LOADING_TIME = 1250;
|
const LOADING_TIME = 1250;
|
||||||
@@ -44,7 +41,6 @@ export const RetweetButton = ({ tweetId, isRetweet, retweetId }: IProps) => {
|
|||||||
}, LOADING_TIME);
|
}, LOADING_TIME);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<Button disabled>
|
<Button disabled>
|
||||||
@@ -53,7 +49,7 @@ export const RetweetButton = ({ tweetId, isRetweet, retweetId }: IProps) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const className = retweeted ? classes.iconFilled : classes.icon;
|
const className = retweeted ? classes.iconFilled : '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button onClick={handleClick}>
|
<Button onClick={handleClick}>
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
bottom: '15px',
|
bottom: '15px',
|
||||||
right: '15px',
|
right: '15px',
|
||||||
},
|
},
|
||||||
button: {
|
|
||||||
background: '#00acee',
|
|
||||||
},
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export function ProfileUpdateButton({ handleClick }) {
|
export function ProfileUpdateButton({ handleClick }) {
|
||||||
@@ -19,7 +16,7 @@ export function ProfileUpdateButton({ handleClick }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<Fab className={classes.button} color="primary" onClick={handleClick}>
|
<Fab color="primary" onClick={handleClick}>
|
||||||
<SearchIcon />
|
<SearchIcon />
|
||||||
</Fab>
|
</Fab>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import React from 'react';
|
|||||||
import { IconButton } from '@material-ui/core';
|
import { IconButton } from '@material-ui/core';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import CloseIcon from '@material-ui/icons/Close';
|
import CloseIcon from '@material-ui/icons/Close';
|
||||||
|
import { PictureReveal } from '../../../../ui/components/PictureReveal';
|
||||||
|
import { PictureResponsive } from '../../../../ui/components/PictureResponsive';
|
||||||
|
|
||||||
const useStyles = makeStyles(() => ({
|
const useStyles = makeStyles(() => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -24,19 +26,9 @@ const useStyles = makeStyles(() => ({
|
|||||||
backgroundColor: '#000',
|
backgroundColor: '#000',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
img: {
|
|
||||||
maxHeight: '125px', // constrain images so we don't overwhelm the UI
|
|
||||||
maxWidth: '300px',
|
|
||||||
padding: '0px 3px 3px 0px',
|
|
||||||
},
|
|
||||||
imgSmall: {
|
|
||||||
maxHeight: '200px', // constrain images so we don't overwhelm the UI
|
|
||||||
maxWidth: '100%',
|
|
||||||
padding: '0px 1px 1px 0px',
|
|
||||||
},
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const Image = ({ link, handleClick, small }) => {
|
export const Image = ({ link, handleClick }) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<div className={classes.imageContainer}>
|
<div className={classes.imageContainer}>
|
||||||
@@ -45,7 +37,9 @@ export const Image = ({ link, handleClick, small }) => {
|
|||||||
<CloseIcon />
|
<CloseIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
<img alt="small avatar" className={small ? classes.imgSmall : classes.img} src={link} />
|
<PictureReveal>
|
||||||
|
<PictureResponsive alt="small avatar" src={link} />
|
||||||
|
</PictureReveal>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { Box } from '@material-ui/core';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import Image from './Image';
|
import Image from './Image';
|
||||||
@@ -5,19 +6,16 @@ import Image from './Image';
|
|||||||
export const ImageDisplay = ({ visible, images, removeImage, small }) => {
|
export const ImageDisplay = ({ visible, images, removeImage, small }) => {
|
||||||
if (!visible || !images || images.length === 0) return null;
|
if (!visible || !images || images.length === 0) return null;
|
||||||
|
|
||||||
const styles = { margin: small ? '2px 0px' : '2px 15px' };
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={styles}>
|
<Box p={1}>
|
||||||
{images.map((image) => (
|
{images.map((image) => (
|
||||||
<Image
|
<Image
|
||||||
key={image.id}
|
key={image.id}
|
||||||
link={image.link}
|
link={image.link}
|
||||||
handleClick={removeImage ? () => removeImage(image.id) : null}
|
handleClick={removeImage ? () => removeImage(image.id) : null}
|
||||||
small={small}
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,11 @@ import { makeStyles } from '@material-ui/core/styles';
|
|||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { faRetweet } from '@fortawesome/free-solid-svg-icons';
|
import { faRetweet } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
import { ITwitterTheme } from '../../twitter.theme';
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
profileName: string;
|
profileName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: ITwitterTheme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
color: theme.palette.secondary.main,
|
color: theme.palette.secondary.main,
|
||||||
fontSize: '16px',
|
fontSize: '16px',
|
||||||
@@ -18,18 +16,18 @@ const useStyles = makeStyles((theme: ITwitterTheme) => ({
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
paddingBottom: '8px',
|
paddingBottom: '8px',
|
||||||
marginBottom: '6px',
|
marginBottom: '6px',
|
||||||
marginTop: '-6px'
|
marginTop: '-6px',
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
function Retweet({ profileName }: IProps) {
|
function Retweet({ profileName }: IProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<FontAwesomeIcon icon={faRetweet} /> {profileName} {t('APPS_TWITTER_RETWEETED')}
|
<FontAwesomeIcon icon={faRetweet} /> {profileName} {t('APPS_TWITTER_RETWEETED')}
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Retweet;
|
export default Retweet;
|
||||||
@@ -78,7 +78,6 @@ export const Tweet = (tweet: ITweet) => {
|
|||||||
isMine,
|
isMine,
|
||||||
isReported,
|
isReported,
|
||||||
isRetweet,
|
isRetweet,
|
||||||
isRetweetedByPlayer,
|
|
||||||
} = tweet;
|
} = tweet;
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -137,12 +136,7 @@ export const Tweet = (tweet: ITweet) => {
|
|||||||
<div className={classes.buttonContainer}>
|
<div className={classes.buttonContainer}>
|
||||||
<ReplyButton profile_name={profile_name} />
|
<ReplyButton profile_name={profile_name} />
|
||||||
<LikeButton tweetId={id} isLiked={isLiked} />
|
<LikeButton tweetId={id} isLiked={isLiked} />
|
||||||
{!isMine && (
|
{!isMine && <RetweetButton tweetId={id} retweetId={retweetId} isRetweet={isRetweet} />}
|
||||||
<RetweetButton
|
|
||||||
tweetId={id}
|
|
||||||
retweetId={retweetId}
|
|
||||||
isRetweet={isRetweet}
|
|
||||||
/>)}
|
|
||||||
<ShowMore isMine={isMine} isReported={isReported} id={id} />
|
<ShowMore isMine={isMine} isReported={isReported} id={id} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { Tweet } from '../../../common/typings/twitter';
|
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||||
|
|
||||||
import { useApp } from '../../../os/apps/hooks/useApps';
|
import { useApp } from '../../../os/apps/hooks/useApps';
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import { useEffect } from 'react';
|
|
||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||||
import Nui from '../../../os/nui-events/utils/Nui';
|
|
||||||
import { IMAGE_DELIMITER } from '../utils/images';
|
import { IMAGE_DELIMITER } from '../utils/images';
|
||||||
import { APP_TWITTER } from '../utils/constants';
|
import { APP_TWITTER } from '../utils/constants';
|
||||||
import { twitterState } from './state';
|
import { twitterState } from './state';
|
||||||
|
|||||||
@@ -1,27 +1,19 @@
|
|||||||
import { blue, common } from '@material-ui/core/colors';
|
import { common } from '@material-ui/core/colors';
|
||||||
|
|
||||||
export const CONTACTS_APP_PRIMARY_COLOR = blue[500];
|
export const TWITTER_APP_PRIMARY_COLOR = '#00acee';
|
||||||
export const CONTACTS_APP_TEXT_COLOR = common.white;
|
export const TWITTER_APP_TEXT_COLOR = common.white;
|
||||||
|
|
||||||
export interface ITwitterTheme {
|
const theme = {
|
||||||
palette: {
|
palette: {
|
||||||
twitter: {
|
primary: {
|
||||||
main: string;
|
main: TWITTER_APP_PRIMARY_COLOR,
|
||||||
},
|
dark: '#0488ba',
|
||||||
secondary: {
|
light: '#3dbbeb',
|
||||||
main: string;
|
contrastText: TWITTER_APP_TEXT_COLOR,
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const theme: ITwitterTheme = {
|
|
||||||
palette: {
|
|
||||||
twitter: {
|
|
||||||
main: "#00acee",
|
|
||||||
},
|
},
|
||||||
secondary: {
|
secondary: {
|
||||||
main: '#999',
|
main: '#999',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -114,6 +114,7 @@
|
|||||||
"label": "100%",
|
"label": "100%",
|
||||||
"value": 1
|
"value": 1
|
||||||
},
|
},
|
||||||
|
"streamerMode": false,
|
||||||
"ringtone": {
|
"ringtone": {
|
||||||
"label": "Pixel",
|
"label": "Pixel",
|
||||||
"value": "pixel"
|
"value": "pixel"
|
||||||
|
|||||||
@@ -115,6 +115,7 @@
|
|||||||
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
||||||
"APPS_SETTINGS_OPTION_THEME": "Theme",
|
"APPS_SETTINGS_OPTION_THEME": "Theme",
|
||||||
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
||||||
|
"APPS_SETTINGS_OPTION_STREAMER_MODE": "Streamer Mode",
|
||||||
"APPS_SETTINGS_OPTION_RINGTONE": "Ringtone",
|
"APPS_SETTINGS_OPTION_RINGTONE": "Ringtone",
|
||||||
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Ringtone Volume",
|
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Ringtone Volume",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Notification Filters",
|
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Notification Filters",
|
||||||
@@ -128,6 +129,7 @@
|
|||||||
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "This listing has already been reported",
|
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "This listing has already been reported",
|
||||||
"APPS_MARKETPLACE_REPORT_LISTING_SUCCESS": "Successfully reported listing",
|
"APPS_MARKETPLACE_REPORT_LISTING_SUCCESS": "Successfully reported listing",
|
||||||
|
|
||||||
|
"GENERIC_CLICK_TO_REVEAL": "Click to reveal",
|
||||||
"GENERIC_WAIT": "Please wait...",
|
"GENERIC_WAIT": "Please wait...",
|
||||||
"GENERIC_SAVE": "Save",
|
"GENERIC_SAVE": "Save",
|
||||||
"GENERIC_UPDATE": "Update",
|
"GENERIC_UPDATE": "Update",
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ import {
|
|||||||
} from '../../../apps/sellout/sellout.theme';
|
} from '../../../apps/sellout/sellout.theme';
|
||||||
import { NOTES_APP_ICON_COLOR, NOTES_APP_PRIMARY_COLOR } from '../../../apps/notes/notes.theme';
|
import { NOTES_APP_ICON_COLOR, NOTES_APP_PRIMARY_COLOR } from '../../../apps/notes/notes.theme';
|
||||||
import { DIALER_APP_PRIMARY_COLOR, DIALER_APP_TEXT_COLOR } from '../../../apps/dialer/dialer.theme';
|
import { DIALER_APP_PRIMARY_COLOR, DIALER_APP_TEXT_COLOR } from '../../../apps/dialer/dialer.theme';
|
||||||
|
import {
|
||||||
|
TWITTER_APP_PRIMARY_COLOR,
|
||||||
|
TWITTER_APP_TEXT_COLOR,
|
||||||
|
} from '../../../apps/twitter/twitter.theme';
|
||||||
|
|
||||||
export interface IAppConfig {
|
export interface IAppConfig {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -120,8 +124,8 @@ export const APPS: IAppConfig[] = [
|
|||||||
nameLocale: 'APPS_TWITTER',
|
nameLocale: 'APPS_TWITTER',
|
||||||
icon: <FontAwesomeIcon icon={faTwitter} fixedWidth />,
|
icon: <FontAwesomeIcon icon={faTwitter} fixedWidth />,
|
||||||
notificationIcon: <FontAwesomeIcon icon={faTwitter} fixedWidth size="xs" />,
|
notificationIcon: <FontAwesomeIcon icon={faTwitter} fixedWidth size="xs" />,
|
||||||
backgroundColor: blue[600],
|
backgroundColor: TWITTER_APP_PRIMARY_COLOR,
|
||||||
color: common.white,
|
color: TWITTER_APP_TEXT_COLOR,
|
||||||
path: '/twitter',
|
path: '/twitter',
|
||||||
Route: () => <AppRoute id="TWITTER" path="/twitter" component={TwitterApp} />,
|
Route: () => <AppRoute id="TWITTER" path="/twitter" component={TwitterApp} />,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const CallModal = () => {
|
|||||||
<AppContent>
|
<AppContent>
|
||||||
<Box pt={24}>
|
<Box pt={24}>
|
||||||
<h1 style={{ textAlign: 'center' }}>
|
<h1 style={{ textAlign: 'center' }}>
|
||||||
{myNumber == call?.transmitter ? call?.receiver : call?.transmitter}
|
{myNumber === call?.transmitter ? call?.receiver : call?.transmitter}
|
||||||
</h1>
|
</h1>
|
||||||
<CallTimer isAccepted={call?.accepted} />
|
<CallTimer isAccepted={call?.accepted} />
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -26,6 +26,6 @@ export const getSoundSettings = (
|
|||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('getSoundSettings.ts error', e, 'Using default sounds');
|
console.error('getSoundSettings.ts error', e, 'Using default sounds');
|
||||||
return { sound: getPath[type](), volume: 1 };
|
return { sound: getPath[type](), volume: 0 };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { Box, makeStyles, Theme } from '@material-ui/core';
|
||||||
|
import { useSettings } from '../../apps/settings/hooks/useSettings';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
children: JSX.Element;
|
||||||
|
}
|
||||||
|
|
||||||
|
const useStyles = makeStyles<Theme, { covered: boolean }>((theme) => ({
|
||||||
|
cover: {
|
||||||
|
cursor: 'pointer',
|
||||||
|
backgroundColor: theme.palette.background.default,
|
||||||
|
color: theme.palette.getContrastText(theme.palette.background.default),
|
||||||
|
visibility: ({ covered }) => (covered ? 'visible' : 'hidden'),
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
export const PictureReveal = ({ children }: IProps) => {
|
||||||
|
const [settings] = useSettings();
|
||||||
|
const [covered, setCovered] = useState<boolean>(false);
|
||||||
|
const [ready, setReady] = useState<boolean>(false);
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const classes = useStyles({ covered });
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (settings.streamerMode === true) {
|
||||||
|
setCovered(true);
|
||||||
|
}
|
||||||
|
setReady(true);
|
||||||
|
}, [settings.streamerMode]);
|
||||||
|
|
||||||
|
const onClickCover = () => setCovered(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box width="100%" position="relative">
|
||||||
|
<Box
|
||||||
|
onClick={onClickCover}
|
||||||
|
className={classes.cover}
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
position="absolute"
|
||||||
|
display="flex"
|
||||||
|
alignItems="center"
|
||||||
|
justifyContent="center"
|
||||||
|
top={0}
|
||||||
|
left={0}
|
||||||
|
>
|
||||||
|
{t('GENERIC_CLICK_TO_REVEAL')}
|
||||||
|
</Box>
|
||||||
|
<Box width="100%" height="100%" visibility={ready ? 'visible' : 'hidden'}>
|
||||||
|
{children}
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
Reference in new issue
Block a user