mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
working typescript version
This commit is contained in:
1 parent
581d6011e0
commit
cff746aa38
119 files changed
+247
-189
No files matched your search
+6
-2
@@ -127,7 +127,7 @@ export const AddTweetModal = () => {
|
||||
withValidImage(cleanedLink, () => setImages([...images, image]));
|
||||
|
||||
setShowImagePrompt(false);
|
||||
setLink('')
|
||||
setLink("");
|
||||
};
|
||||
const removeImage = (id) =>
|
||||
setImages(images.filter((image) => id !== image.id));
|
||||
@@ -171,7 +171,11 @@ export const AddTweetModal = () => {
|
||||
/>
|
||||
<div className={classes.buttonsContainer}>
|
||||
<IconButtons
|
||||
onImageClick={images.length < config.twitter.maxImages ? toggleShowImagePrompt : null}
|
||||
onImageClick={
|
||||
images.length < config.twitter.maxImages
|
||||
? toggleShowImagePrompt
|
||||
: null
|
||||
}
|
||||
onEmojiClick={toggleShowEmoji}
|
||||
/>
|
||||
<ControlButtons
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+11
-7
@@ -21,18 +21,22 @@ const useStyles = makeStyles((theme) => ({
|
||||
export const IconButtons = ({ onImageClick, onEmojiClick }) => {
|
||||
const classes = useStyles();
|
||||
const { config } = usePhone();
|
||||
|
||||
|
||||
if (!config) return null;
|
||||
const { enableImages, enableEmojis } = config.twitter;
|
||||
|
||||
return (
|
||||
<div className={classes.buttons}>
|
||||
{enableImages && (<Button className={classes.button} onClick={onImageClick}>
|
||||
<InsertPhotoIcon color="action" />
|
||||
</Button>)}
|
||||
{enableEmojis && (<Button className={classes.button} onClick={onEmojiClick}>
|
||||
<EmojiIcon color="action" />
|
||||
</Button>)}
|
||||
{enableImages && (
|
||||
<Button className={classes.button} onClick={onImageClick}>
|
||||
<InsertPhotoIcon color="action" />
|
||||
</Button>
|
||||
)}
|
||||
{enableEmojis && (
|
||||
<Button className={classes.button} onClick={onEmojiClick}>
|
||||
<EmojiIcon color="action" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-2
@@ -27,7 +27,6 @@ export function Profile() {
|
||||
const { profile } = useProfile();
|
||||
const { config } = usePhone();
|
||||
|
||||
|
||||
// note that this assumes we are defensively checking
|
||||
// that profile is not null in a parent above this component.
|
||||
// Annoyingling adding conditionals above this line to not render
|
||||
@@ -50,7 +49,7 @@ export function Profile() {
|
||||
Nui.send("phone:updateTwitterProfile", data);
|
||||
};
|
||||
|
||||
// fetching the config is an asynchronous call so defend against it
|
||||
// fetching the config is an asynchronous call so defend against it
|
||||
if (!config) return null;
|
||||
|
||||
const { enableAvatars, allowEdtiableProfileName } = config.twitter;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+5
-2
@@ -23,8 +23,11 @@ export const TweetMessage = ({ message, handleChange }) => {
|
||||
const { config } = usePhone();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const overCharacterLimit = message.trim().length > config.twitter.characterLimit;
|
||||
const characterWarningPrompt = `${t("APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT")} (${config.twitter.characterLimit})`;
|
||||
const overCharacterLimit =
|
||||
message.trim().length > config.twitter.characterLimit;
|
||||
const characterWarningPrompt = `${t(
|
||||
"APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT"
|
||||
)} (${config.twitter.characterLimit})`;
|
||||
|
||||
return (
|
||||
<TextField
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -12,7 +12,10 @@ const DAYS = "APPS_TWITTER_TIME_DAYS";
|
||||
* @param {function} t - translation object passed from a component implementing the hook
|
||||
* @param {number} seconds - seconds to translate to a string
|
||||
*/
|
||||
export function secondsToHumanReadable(t, seconds) {
|
||||
export function secondsToHumanReadable(
|
||||
t: (input: string) => string,
|
||||
seconds: number
|
||||
): string {
|
||||
if (seconds < 60) {
|
||||
return t(JUST_NOW);
|
||||
} else if (seconds < ONE_HOUR) {
|
||||
Reference in new issue
Block a user