mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
120 in printWidth since rocky got md
This commit is contained in:
1 parent
f552c1212c
commit
d27aeb3b0e
90 files changed
+398
-1146
No files matched your search
@@ -106,10 +106,7 @@ 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);
|
||||
@@ -158,27 +155,13 @@ export const AddTweetModal = () => {
|
||||
|
||||
return (
|
||||
<Modal visible={modalVisible} handleClose={_handleClose}>
|
||||
<TweetMessage
|
||||
modalVisible={modalVisible}
|
||||
message={message}
|
||||
handleChange={handleMessageChange}
|
||||
/>
|
||||
<ImagePrompt
|
||||
visible={showImagePrompt}
|
||||
value={link}
|
||||
handleChange={handleimageChange}
|
||||
/>
|
||||
<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
|
||||
}
|
||||
onImageClick={images.length < config.twitter.maxImages ? toggleShowImagePrompt : null}
|
||||
onEmojiClick={toggleShowEmoji}
|
||||
/>
|
||||
<ControlButtons
|
||||
|
||||
@@ -18,16 +18,8 @@ export function TwitterBottomNavigation({ activePage, handleChange }) {
|
||||
return (
|
||||
<BottomNavigation value={activePage} onChange={handleChange} className={classes.root}>
|
||||
<BottomNavigationAction component={Link} to="/twitter" icon={<HomeIcon />} />
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
to="/twitter/search"
|
||||
icon={<SearchIcon />}
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
to="/twitter/profile"
|
||||
icon={<ProfileIcon />}
|
||||
/>
|
||||
<BottomNavigationAction component={Link} to="/twitter/search" icon={<SearchIcon />} />
|
||||
<BottomNavigationAction component={Link} to="/twitter/profile" icon={<ProfileIcon />} />
|
||||
</BottomNavigation>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -59,8 +59,7 @@ export const TwitterApp = () => {
|
||||
|
||||
// before any other action can be taken by the user we force
|
||||
// them have a profile name
|
||||
const promptProfileName =
|
||||
profile && (!profile.profile_name || !profile.profile_name.trim());
|
||||
const promptProfileName = profile && (!profile.profile_name || !profile.profile_name.trim());
|
||||
|
||||
const openModal = () => setModalVisible(true);
|
||||
const handlePageChange = (e, page) => setActivePage(page);
|
||||
@@ -83,9 +82,7 @@ export const TwitterApp = () => {
|
||||
)}
|
||||
</AppContent>
|
||||
{showTweetButton && <TweetButton openModal={openModal} />}
|
||||
{!promptProfileName && (
|
||||
<BottomNavigation activePage={activePage} handleChange={handlePageChange} />
|
||||
)}
|
||||
{!promptProfileName && <BottomNavigation activePage={activePage} handleChange={handlePageChange} />}
|
||||
</AppWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -16,19 +16,12 @@ const useStyles = makeStyles((theme) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const ControlButtons = ({
|
||||
showImagePrompt,
|
||||
showEmoji,
|
||||
onCloseClick,
|
||||
onPrimaryClick,
|
||||
}) => {
|
||||
export const ControlButtons = ({ showImagePrompt, showEmoji, onCloseClick, onPrimaryClick }) => {
|
||||
const classes = useStyles();
|
||||
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 (
|
||||
@@ -37,12 +30,7 @@ export const ControlButtons = ({
|
||||
{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>
|
||||
)}
|
||||
|
||||
@@ -28,11 +28,7 @@ function LikeButton({ tweetId, isLiked }) {
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Button onClick={handleClick}>
|
||||
{liked ? <FavoriteIcon /> : <FavoriteBorderIcon />}
|
||||
</Button>
|
||||
);
|
||||
return <Button onClick={handleClick}>{liked ? <FavoriteIcon /> : <FavoriteBorderIcon />}</Button>;
|
||||
}
|
||||
|
||||
export default LikeButton;
|
||||
@@ -35,12 +35,7 @@ export function ProfileUpdateButton({ handleClick }) {
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<Fab
|
||||
className={classes.button}
|
||||
color="primary"
|
||||
onClick={handleClick}
|
||||
disabled={isLoading}
|
||||
>
|
||||
<Fab className={classes.button} color="primary" onClick={handleClick} disabled={isLoading}>
|
||||
<PublishIcon />
|
||||
</Fab>
|
||||
</div>
|
||||
|
||||
@@ -45,11 +45,7 @@ export const Image = ({ link, handleClick, small }) => {
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
)}
|
||||
<img
|
||||
alt="small avatar"
|
||||
className={small ? classes.imgSmall : classes.img}
|
||||
src={link}
|
||||
/>
|
||||
<img alt="small avatar" className={small ? classes.imgSmall : classes.img} src={link} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -23,9 +23,7 @@ export const ImagePrompt = ({ visible, value, handleChange }) => {
|
||||
textFieldRef.current && textFieldRef.current.focus();
|
||||
}, [visible]);
|
||||
|
||||
const handleImageChange = useCallback((e) => handleChange(e.target.value), [
|
||||
handleChange,
|
||||
]);
|
||||
const handleImageChange = useCallback((e) => handleChange(e.target.value), [handleChange]);
|
||||
|
||||
if (!visible) return null;
|
||||
return (
|
||||
|
||||
@@ -70,22 +70,13 @@ 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,12 +76,8 @@ 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>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
import React, { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import {
|
||||
ListItemAvatar,
|
||||
Avatar as MuiAvatar,
|
||||
ListItem,
|
||||
Typography,
|
||||
} from '@material-ui/core';
|
||||
import { ListItemAvatar, Avatar as MuiAvatar, ListItem, Typography } from '@material-ui/core';
|
||||
import { secondsToHumanReadable } from '../../utils/time';
|
||||
import LikeButton from '../buttons/LikeButton';
|
||||
import ReplyButton from '../buttons/ReplyButton';
|
||||
@@ -61,17 +56,7 @@ 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();
|
||||
@@ -105,12 +90,7 @@ 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,14 +51,10 @@ 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;
|
||||
|
||||
Reference in new issue
Block a user