mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
printWidth: 100
This commit is contained in:
1 parent
d27aeb3b0e
commit
6f4ee009a9
63 files changed
+602
-223
No files matched your search
@@ -30,9 +30,21 @@ export const NavigationBar = () => {
|
||||
showLabels
|
||||
className={classes.root}
|
||||
>
|
||||
<BottomNavigationAction component={Link} icon={<FontAwesomeIcon icon={faHome} />} to="/bank" />
|
||||
<BottomNavigationAction component={Link} icon={<FontAwesomeIcon icon={faMoneyCheck} />} to="/bank/account" />
|
||||
<BottomNavigationAction component={Link} icon={<FontAwesomeIcon icon={faList} />} to="/bank/transactions" />
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faHome} />}
|
||||
to="/bank"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faMoneyCheck} />}
|
||||
to="/bank/account"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faList} />}
|
||||
to="/bank/transactions"
|
||||
/>
|
||||
</BottomNavigation>
|
||||
);
|
||||
};
|
||||
@@ -33,20 +33,22 @@ export const TransactionList = () => {
|
||||
</div>
|
||||
|
||||
<div className={classes.transcationDiv}>
|
||||
{transactionList.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((transaction: any) => (
|
||||
<div className={classes.transactions}>
|
||||
<div>
|
||||
<h1 className={classes.tranSource}>{transaction.source}</h1>
|
||||
<p className={classes.tranType}>{transaction.type}</p>
|
||||
{transactionList
|
||||
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
||||
.map((transaction: any) => (
|
||||
<div className={classes.transactions}>
|
||||
<div>
|
||||
<h1 className={classes.tranSource}>{transaction.source}</h1>
|
||||
<p className={classes.tranType}>{transaction.type}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className={TransactionTypes[transaction.type]}>
|
||||
{transaction.type === 'Withdraw' ? '-' : '+'}
|
||||
{transaction.amount}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p className={TransactionTypes[transaction.type]}>
|
||||
{transaction.type === 'Withdraw' ? '-' : '+'}
|
||||
{transaction.amount}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
))}
|
||||
<TablePagination
|
||||
rowsPerPageOptions={[3, 5]}
|
||||
className={classes.pagination}
|
||||
|
||||
@@ -18,7 +18,10 @@ export const GalleryModal = () => {
|
||||
|
||||
const [shareOpen, setShareOpen] = useState(null);
|
||||
|
||||
const meta: ICameraPhoto = useMemo(() => ({ id: query.id as string, image: query.image as string }), [query]);
|
||||
const meta: ICameraPhoto = useMemo(
|
||||
() => ({ id: query.id as string, image: query.image as string }),
|
||||
[query],
|
||||
);
|
||||
|
||||
const _handleClose = () => {
|
||||
history.push(referal);
|
||||
|
||||
@@ -28,7 +28,9 @@ export const ShareModal = ({ meta, onClose, referal }: IShareModalProps) => {
|
||||
<div className={classes.shareModal}>
|
||||
<div className={classes.innerShareModal}>
|
||||
<>
|
||||
<h4 style={{ textAlign: 'center', marginTop: 20 }}>Where do you want to share the photo?</h4>
|
||||
<h4 style={{ textAlign: 'center', marginTop: 20 }}>
|
||||
Where do you want to share the photo?
|
||||
</h4>
|
||||
<Button>{<MessageIcon />} Message</Button>
|
||||
<h4>Or just copy the image here:</h4>
|
||||
<Button onClick={handleCopyImage} variant="contained">
|
||||
|
||||
@@ -48,7 +48,10 @@ export const ContactList = () => {
|
||||
<SearchContacts />
|
||||
<List>
|
||||
{contacts
|
||||
.filter((contact) => contact.display.match(filteredRegEx) || contact.number.match(filteredRegEx))
|
||||
.filter(
|
||||
(contact) =>
|
||||
contact.display.match(filteredRegEx) || contact.number.match(filteredRegEx),
|
||||
)
|
||||
.map((contact) => (
|
||||
<ListItem key={contact.id} divider>
|
||||
<ListItemAvatar>
|
||||
|
||||
@@ -25,7 +25,11 @@ export const ContactPage = () => {
|
||||
return (
|
||||
<>
|
||||
<ContactList />
|
||||
<Fab color="primary" onClick={() => history.push('/contacts/-1')} className={classes.absolute}>
|
||||
<Fab
|
||||
color="primary"
|
||||
onClick={() => history.push('/contacts/-1')}
|
||||
className={classes.absolute}
|
||||
>
|
||||
<PersonAddIcon />
|
||||
</Fab>
|
||||
</>
|
||||
|
||||
@@ -27,7 +27,13 @@ const DialerNavBar = () => {
|
||||
|
||||
return (
|
||||
<BottomNavigation value={page} onChange={handleChange} showLabels className={classes.root}>
|
||||
<BottomNavigationAction label="History" value="/phone" component={NavLink} icon={<HistoryIcon />} to="/phone" />
|
||||
<BottomNavigationAction
|
||||
label="History"
|
||||
value="/phone"
|
||||
component={NavLink}
|
||||
icon={<HistoryIcon />}
|
||||
to="/phone"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
label="Dial"
|
||||
value="/phone/dial"
|
||||
|
||||
@@ -68,7 +68,9 @@ export const DialerHistory = ({ calls }) => {
|
||||
|
||||
{getDisplayByNumber(call.transmitter) === call.transmitter ? (
|
||||
<IconButton
|
||||
onClick={() => history.push(`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`)}
|
||||
onClick={() =>
|
||||
history.push(`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`)
|
||||
}
|
||||
>
|
||||
{<PersonAddIcon />}
|
||||
</IconButton>
|
||||
@@ -86,7 +88,9 @@ export const DialerHistory = ({ calls }) => {
|
||||
|
||||
{getDisplayByNumber(call.transmitter) === call.transmitter ? (
|
||||
<IconButton
|
||||
onClick={() => history.push(`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`)}
|
||||
onClick={() =>
|
||||
history.push(`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`)
|
||||
}
|
||||
>
|
||||
{<PersonAddIcon />}
|
||||
</IconButton>
|
||||
|
||||
@@ -35,7 +35,9 @@ export const ExampleApp = () => {
|
||||
<Button color="primary">{example.id}</Button>
|
||||
{/* Here we are using the value in a h3 tag */}
|
||||
<h3>{exampleString}</h3>
|
||||
<IconButton onClick={() => (playing ? stop() : play())}>{playing ? <StopIcon /> : <PlayIcon />}</IconButton>
|
||||
<IconButton onClick={() => (playing ? stop() : play())}>
|
||||
{playing ? <StopIcon /> : <PlayIcon />}
|
||||
</IconButton>
|
||||
<Button onClick={toggleSound}>Change sound on the fly</Button>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
|
||||
@@ -38,7 +38,11 @@ export const MessagesApp = () => {
|
||||
/>
|
||||
</Switch>
|
||||
<Switch>
|
||||
<Route exact path={['/messages/new/:phoneNumber', '/messages/new']} render={() => <MessageGroupModal />} />
|
||||
<Route
|
||||
exact
|
||||
path={['/messages/new/:phoneNumber', '/messages/new']}
|
||||
render={() => <MessageGroupModal />}
|
||||
/>
|
||||
</Switch>
|
||||
</AppContent>
|
||||
<NewMessageGroupButton onClick={() => history.push('/messages/new')} />
|
||||
|
||||
@@ -99,7 +99,13 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
||||
</Box>
|
||||
)}
|
||||
<Box px={2} py={3}>
|
||||
<Button disabled={submitDisabled} variant="contained" fullWidth color="primary" type="submit">
|
||||
<Button
|
||||
disabled={submitDisabled}
|
||||
variant="contained"
|
||||
fullWidth
|
||||
color="primary"
|
||||
type="submit"
|
||||
>
|
||||
{t('APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT')}
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
@@ -18,7 +18,10 @@ const MessagesList = (): any => {
|
||||
const [searchValue, setSearchValue] = useState('');
|
||||
|
||||
const goToConversation = useCallback(
|
||||
(messageGroup) => history.push(`/messages/conversations/${messageGroup.groupId}/?${qs.stringify(messageGroup)}`),
|
||||
(messageGroup) =>
|
||||
history.push(
|
||||
`/messages/conversations/${messageGroup.groupId}/?${qs.stringify(messageGroup)}`,
|
||||
),
|
||||
[history],
|
||||
);
|
||||
|
||||
@@ -55,7 +58,11 @@ const MessagesList = (): any => {
|
||||
<MessageSearch value={searchValue} handleChange={(e) => setSearchValue(e.target.value)} />
|
||||
<List className={classes.root}>
|
||||
{filteredGroups.map((messageGroup) => (
|
||||
<MessageGroupItem key={messageGroup.groupId} messageGroup={messageGroup} handleClick={handleClick} />
|
||||
<MessageGroupItem
|
||||
key={messageGroup.groupId}
|
||||
messageGroup={messageGroup}
|
||||
handleClick={handleClick}
|
||||
/>
|
||||
))}
|
||||
</List>
|
||||
</>
|
||||
|
||||
@@ -38,10 +38,17 @@ const Conversation = ({ activeMessageGroup, messages }: IProps) => {
|
||||
className={classes.overflowAutoY}
|
||||
>
|
||||
{messages.map((message) => (
|
||||
<MessageBubble key={message.id} message={message} isGroupChat={activeMessageGroup?.isGroupChat} />
|
||||
<MessageBubble
|
||||
key={message.id}
|
||||
message={message}
|
||||
isGroupChat={activeMessageGroup?.isGroupChat}
|
||||
/>
|
||||
))}
|
||||
</Box>
|
||||
<MessageInput messageGroupId={activeMessageGroup.groupId} onAddImageClick={() => setImageModalOpen(true)} />
|
||||
<MessageInput
|
||||
messageGroupId={activeMessageGroup.groupId}
|
||||
onAddImageClick={() => setImageModalOpen(true)}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -41,7 +41,13 @@ const isImage = (url) => {
|
||||
return /(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|png|jpeg|gif)/g.test(url);
|
||||
};
|
||||
|
||||
export const MessageBubble = ({ message, isGroupChat }: { message: Message; isGroupChat: boolean }) => {
|
||||
export const MessageBubble = ({
|
||||
message,
|
||||
isGroupChat,
|
||||
}: {
|
||||
message: Message;
|
||||
isGroupChat: boolean;
|
||||
}) => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -77,7 +77,8 @@ export const MessageModal = () => {
|
||||
const truncatedHeader = `${header.slice(0, MAX_HEADER_CHARS).trim()}...`;
|
||||
header = header.length > MAX_HEADER_CHARS ? activeMessageGroup?.label || truncatedHeader : header;
|
||||
|
||||
const headerClass = header.length > LARGE_HEADER_CHARS ? classes.largeGroupDisplay : classes.groupdisplay;
|
||||
const headerClass =
|
||||
header.length > LARGE_HEADER_CHARS ? classes.largeGroupDisplay : classes.groupdisplay;
|
||||
|
||||
return (
|
||||
<Slide direction="left" in={!!activeMessageGroup}>
|
||||
|
||||
@@ -14,9 +14,10 @@ export default (): IUseMessages => {
|
||||
const [messages, setMessages] = useRecoilState<Message[] | null>(messageState.messages);
|
||||
const messageGroups = useRecoilValue<MessageGroup[] | null>(messageState.messageGroups);
|
||||
|
||||
const [createMessageGroupResult, setCreateMessageGroupResult] = useRecoilState<CreateMessageGroupResult | null>(
|
||||
messageState.createMessageGroupResult,
|
||||
);
|
||||
const [
|
||||
createMessageGroupResult,
|
||||
setCreateMessageGroupResult,
|
||||
] = useRecoilState<CreateMessageGroupResult | null>(messageState.createMessageGroupResult);
|
||||
|
||||
const clearMessageGroupResult = () => setCreateMessageGroupResult(null);
|
||||
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
import { Button, TextField, Slide, Paper, Typography, Container, CircularProgress, Box } from '@material-ui/core';
|
||||
import {
|
||||
Button,
|
||||
TextField,
|
||||
Slide,
|
||||
Paper,
|
||||
Typography,
|
||||
Container,
|
||||
CircularProgress,
|
||||
Box,
|
||||
} from '@material-ui/core';
|
||||
import React from 'react';
|
||||
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||
import { useNoteDetail } from '../hooks/useNoteDetail';
|
||||
|
||||
@@ -54,7 +54,10 @@ export const SelloutItem = (listing) => {
|
||||
<Typography className={classes.headerTypo} variant="h5">
|
||||
{listing.name}
|
||||
</Typography>
|
||||
<Typography className={classes.headerTypo} style={{ borderBottom: '1px solid #f44336' }}>
|
||||
<Typography
|
||||
className={classes.headerTypo}
|
||||
style={{ borderBottom: '1px solid #f44336' }}
|
||||
>
|
||||
{listing.number}
|
||||
</Typography>
|
||||
<Typography variant="h5" style={{ padding: 5 }}>
|
||||
|
||||
@@ -28,7 +28,11 @@ export const NavigationBar = () => {
|
||||
showLabels
|
||||
className={classes.root}
|
||||
>
|
||||
<BottomNavigationAction component={Link} icon={<FontAwesomeIcon icon={faHome} />} to="/sellout" />
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faHome} />}
|
||||
to="/sellout"
|
||||
/>
|
||||
<BottomNavigationAction component={Link} icon={<AddCircleIcon />} to="/sellout/new" />
|
||||
</BottomNavigation>
|
||||
);
|
||||
|
||||
@@ -10,7 +10,15 @@ import { useApp } from '../../../os/apps/hooks/useApps';
|
||||
import { SettingItem } from './SettingItem';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { Brush, Wallpaper, Phone, Smartphone, ZoomIn, LibraryMusic, VolumeUp } from '@material-ui/icons';
|
||||
import {
|
||||
Brush,
|
||||
Wallpaper,
|
||||
Phone,
|
||||
Smartphone,
|
||||
ZoomIn,
|
||||
LibraryMusic,
|
||||
VolumeUp,
|
||||
} from '@material-ui/icons';
|
||||
|
||||
import {
|
||||
Box,
|
||||
@@ -77,11 +85,15 @@ export const SettingsApp = () => {
|
||||
MapStringOptions(settings.ringtone, (val: string) => handleSettingChange('ringtone', val)),
|
||||
);
|
||||
const notifications = config.notifications.map(
|
||||
MapStringOptions(settings.notification, (val: string) => handleSettingChange('notification', val)),
|
||||
MapStringOptions(settings.notification, (val: string) =>
|
||||
handleSettingChange('notification', val),
|
||||
),
|
||||
);
|
||||
|
||||
const twitterNotifications = config.notifications.map(
|
||||
MapStringOptions(settings.notification, (val: string) => handleSettingChange('TWITTER_notification', val)),
|
||||
MapStringOptions(settings.notification, (val: string) =>
|
||||
handleSettingChange('TWITTER_notification', val),
|
||||
),
|
||||
);
|
||||
|
||||
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
||||
@@ -90,7 +102,11 @@ export const SettingsApp = () => {
|
||||
<AppTitle app={settingsApp} />
|
||||
<AppContent backdrop={isMenuOpen} onClickBackdrop={closeMenu}>
|
||||
<List disablePadding subheader={<SubHeaderComp text="Phone" />}>
|
||||
<SettingItem label={t('APPS_SETTINGS_PHONE_NUMBER')} value={simcard.number} icon={<Phone />} />
|
||||
<SettingItem
|
||||
label={t('APPS_SETTINGS_PHONE_NUMBER')}
|
||||
value={simcard.number}
|
||||
icon={<Phone />}
|
||||
/>
|
||||
<SettingItem
|
||||
label={t('APPS_SETTINGS_OPTION_RINGTONE')}
|
||||
value={settings.ringtone}
|
||||
@@ -102,7 +118,10 @@ export const SettingsApp = () => {
|
||||
<ListItemIcon>
|
||||
<VolumeUp />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={t('APPS_SETTINGS_OPTION_RINGTONEVOL')} secondary={settings.ringtoneVol} />
|
||||
<ListItemText
|
||||
primary={t('APPS_SETTINGS_OPTION_RINGTONEVOL')}
|
||||
secondary={settings.ringtoneVol}
|
||||
/>
|
||||
<ListItemSecondaryAction>
|
||||
<Box p={2} width={150}>
|
||||
<Slider
|
||||
@@ -126,7 +145,10 @@ export const SettingsApp = () => {
|
||||
<ListItemIcon>
|
||||
<VolumeUp />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={t('APPS_SETTINGS_OPTION_NOTIFICATIONVOL')} secondary={settings.notificationVol} />
|
||||
<ListItemText
|
||||
primary={t('APPS_SETTINGS_OPTION_NOTIFICATIONVOL')}
|
||||
secondary={settings.notificationVol}
|
||||
/>
|
||||
<ListItemSecondaryAction>
|
||||
<Box p={2} width={150}>
|
||||
<Slider
|
||||
@@ -194,7 +216,9 @@ export const SettingsApp = () => {
|
||||
min={0}
|
||||
max={100}
|
||||
onChange={handleSliderChange(2)}
|
||||
onChangeCommitted={() => handleSettingChange('TWITTER_notificationVol', sliders[2])}
|
||||
onChangeCommitted={() =>
|
||||
handleSettingChange('TWITTER_notificationVol', sliders[2])
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
</ListItemSecondaryAction>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export const getRingtonePath = (name?: string) => `./media/ringtones/${name || 'pixel'}.ogg`;
|
||||
|
||||
export const getNotificationPath = (name?: string) => `./media/notifications/${name || 'online'}.ogg`;
|
||||
export const getNotificationPath = (name?: string) =>
|
||||
`./media/notifications/${name || 'online'}.ogg`;
|
||||
@@ -106,7 +106,8 @@ export const AddTweetModal = () => {
|
||||
|
||||
const data = {
|
||||
message,
|
||||
images: images && images.length > 0 ? images.map((image) => image.link).join(IMAGE_DELIMITER) : '',
|
||||
images:
|
||||
images && images.length > 0 ? images.map((image) => image.link).join(IMAGE_DELIMITER) : '',
|
||||
realUser: 'testUser',
|
||||
};
|
||||
Nui.send('phone:createTweet', data);
|
||||
@@ -155,10 +156,18 @@ export const AddTweetModal = () => {
|
||||
|
||||
return (
|
||||
<Modal visible={modalVisible} handleClose={_handleClose}>
|
||||
<TweetMessage modalVisible={modalVisible} message={message} handleChange={handleMessageChange} />
|
||||
<TweetMessage
|
||||
modalVisible={modalVisible}
|
||||
message={message}
|
||||
handleChange={handleMessageChange}
|
||||
/>
|
||||
<ImagePrompt visible={showImagePrompt} value={link} handleChange={handleimageChange} />
|
||||
<EmojiSelect visible={showEmoji} onEmojiClick={handleSelectEmoji} />
|
||||
<ImageDisplay visible={!showEmoji && images.length > 0} images={images} removeImage={removeImage} />
|
||||
<ImageDisplay
|
||||
visible={!showEmoji && images.length > 0}
|
||||
images={images}
|
||||
removeImage={removeImage}
|
||||
/>
|
||||
<div className={classes.buttonsContainer}>
|
||||
<IconButtons
|
||||
onImageClick={images.length < config.twitter.maxImages ? toggleShowImagePrompt : null}
|
||||
|
||||
@@ -82,7 +82,9 @@ export const TwitterApp = () => {
|
||||
)}
|
||||
</AppContent>
|
||||
{showTweetButton && <TweetButton openModal={openModal} />}
|
||||
{!promptProfileName && <BottomNavigation activePage={activePage} handleChange={handlePageChange} />}
|
||||
{!promptProfileName && (
|
||||
<BottomNavigation activePage={activePage} handleChange={handlePageChange} />
|
||||
)}
|
||||
</AppWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -21,7 +21,9 @@ export const ControlButtons = ({ showImagePrompt, showEmoji, onCloseClick, onPri
|
||||
const { t } = useTranslation();
|
||||
|
||||
const imagePromptVisible = showImagePrompt && !showEmoji;
|
||||
const primaryButtonText = imagePromptVisible ? t('APPS_TWITTER_SUBMIT_IMAGE') : t('APPS_TWITTER_TWEET');
|
||||
const primaryButtonText = imagePromptVisible
|
||||
? t('APPS_TWITTER_SUBMIT_IMAGE')
|
||||
: t('APPS_TWITTER_TWEET');
|
||||
const showCloseButton = showImagePrompt || showEmoji;
|
||||
|
||||
return (
|
||||
@@ -30,7 +32,12 @@ export const ControlButtons = ({ showImagePrompt, showEmoji, onCloseClick, onPri
|
||||
{primaryButtonText}
|
||||
</Button>
|
||||
{showCloseButton && (
|
||||
<Button className={classes.close} variant="contained" color="secondary" onClick={onCloseClick}>
|
||||
<Button
|
||||
className={classes.close}
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
onClick={onCloseClick}
|
||||
>
|
||||
{t('APPS_TWITTER_CLOSE_IMAGE')}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -70,13 +70,22 @@ export function Profile() {
|
||||
handleChange={handleNameChange}
|
||||
allowChange={allowEdtiableProfileName}
|
||||
/>
|
||||
<ProfileField label={t('APPS_TWITTER_EDIT_PROFILE_BIO')} value={bio} handleChange={handleBioChange} multiline />
|
||||
<ProfileField
|
||||
label={t('APPS_TWITTER_EDIT_PROFILE_BIO')}
|
||||
value={bio}
|
||||
handleChange={handleBioChange}
|
||||
multiline
|
||||
/>
|
||||
<ProfileField
|
||||
label={t('APPS_TWITTER_EDIT_PROFILE_LOCATION')}
|
||||
value={location}
|
||||
handleChange={handleLocationChange}
|
||||
/>
|
||||
<ProfileField label={t('APPS_TWITTER_EDIT_PROFILE_JOB')} value={job} handleChange={handleJobChange} />
|
||||
<ProfileField
|
||||
label={t('APPS_TWITTER_EDIT_PROFILE_JOB')}
|
||||
value={job}
|
||||
handleChange={handleJobChange}
|
||||
/>
|
||||
<ProfileUpdateButton handleClick={handleUpdate} />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -76,8 +76,12 @@ export const ShowMore = ({ id, isReported, isMine }) => {
|
||||
horizontal: 'left',
|
||||
}}
|
||||
>
|
||||
{allowedToDelete && <MenuItem onClick={handleDeleteTweet}>{t('APPS_TWITTER_DELETE')}</MenuItem>}
|
||||
{allowedToReport && <ReportButton handleClose={handleClose} isReported={isReported} tweetId={id} />}
|
||||
{allowedToDelete && (
|
||||
<MenuItem onClick={handleDeleteTweet}>{t('APPS_TWITTER_DELETE')}</MenuItem>
|
||||
)}
|
||||
{allowedToReport && (
|
||||
<ReportButton handleClose={handleClose} isReported={isReported} tweetId={id} />
|
||||
)}
|
||||
</Menu>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -56,7 +56,17 @@ const useStyles = makeStyles(() => ({
|
||||
}));
|
||||
|
||||
export const Tweet = (tweet) => {
|
||||
const { id, message, images, avatar_url, profile_name, seconds_since_tweet, isLiked, isMine, isReported } = tweet;
|
||||
const {
|
||||
id,
|
||||
message,
|
||||
images,
|
||||
avatar_url,
|
||||
profile_name,
|
||||
seconds_since_tweet,
|
||||
isLiked,
|
||||
isMine,
|
||||
isReported,
|
||||
} = tweet;
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const { config } = usePhone();
|
||||
@@ -90,7 +100,12 @@ export const Tweet = (tweet) => {
|
||||
<div className={classes.content}>
|
||||
<div className={classes.primary}>
|
||||
<div className={classes.profile}>{profileName}</div>
|
||||
<Typography className={classes.date} component="div" variant="body2" color="textSecondary">
|
||||
<Typography
|
||||
className={classes.date}
|
||||
component="div"
|
||||
variant="body2"
|
||||
color="textSecondary"
|
||||
>
|
||||
{secondsToHumanReadable(t, seconds_since_tweet)}
|
||||
</Typography>
|
||||
</div>
|
||||
|
||||
@@ -51,10 +51,14 @@ export const TweetMessage = ({ modalVisible, message, handleChange }) => {
|
||||
let errorMessage = null;
|
||||
|
||||
const overCharacterLimit = message.trim().length > characterLimit;
|
||||
const characterWarningPrompt = `${t('APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT')} (${characterLimit})`;
|
||||
const characterWarningPrompt = `${t(
|
||||
'APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT',
|
||||
)} (${characterLimit})`;
|
||||
|
||||
const overNewLineLimit = getNewLineCount(message) > newLineLimit;
|
||||
const newLineWarningPrompt = `${t('APPS_TWITTER_TWEET_MESSAGE_NEW_LINE_LIMIT')} (${newLineLimit})`;
|
||||
const newLineWarningPrompt = `${t(
|
||||
'APPS_TWITTER_TWEET_MESSAGE_NEW_LINE_LIMIT',
|
||||
)} (${newLineLimit})`;
|
||||
|
||||
if (overCharacterLimit) {
|
||||
errorMessage = characterWarningPrompt;
|
||||
|
||||
@@ -19,7 +19,9 @@ interface IUseProfile {
|
||||
export const useProfile = (): IUseProfile => {
|
||||
const profile = useRecoilValue(twitterState.profile);
|
||||
const updateProfileLoading = useRecoilValue(twitterState.updateProfileLoading);
|
||||
const [updateProfileSuccessful, setUpdateProfileSuccessful] = useRecoilState(twitterState.updateProfileSuccess);
|
||||
const [updateProfileSuccessful, setUpdateProfileSuccessful] = useRecoilState(
|
||||
twitterState.updateProfileSuccess,
|
||||
);
|
||||
return {
|
||||
profile,
|
||||
updateProfileLoading,
|
||||
|
||||
@@ -4,7 +4,9 @@ import { twitterState } from './state';
|
||||
|
||||
export const useTweetStatus = () => {
|
||||
const createTweetLoading = useRecoilValue(twitterState.createTweetLoading);
|
||||
const [createTweetSuccessful, setCreateTweetSuccessful] = useRecoilState(twitterState.createTweetSuccessful);
|
||||
const [createTweetSuccessful, setCreateTweetSuccessful] = useRecoilState(
|
||||
twitterState.createTweetSuccessful,
|
||||
);
|
||||
return {
|
||||
createTweetLoading,
|
||||
createTweetSuccessful,
|
||||
|
||||
Reference in new issue
Block a user