mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
styling: Enforced styling across all files (#55)
This commit is contained in:
165 files changed
+1879
-1725
No files matched your search
@@ -1,23 +1,23 @@
|
||||
import React, { useState } from "react";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import React, { useState } from 'react';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import Nui from "../../../../os/nui-events/utils/Nui";
|
||||
import { useProfile } from "../../hooks/useProfile";
|
||||
import Avatar from "../Avatar";
|
||||
import ProfileField from "./ProfileField";
|
||||
import ProfileUpdateButton from "../buttons/ProfileUpdateButton";
|
||||
import { usePhone } from "../../../../os/phone/hooks/usePhone";
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useProfile } from '../../hooks/useProfile';
|
||||
import Avatar from '../Avatar';
|
||||
import ProfileField from './ProfileField';
|
||||
import ProfileUpdateButton from '../buttons/ProfileUpdateButton';
|
||||
import { usePhone } from '../../../../os/phone/hooks/usePhone';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
position: "relative",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
padding: "15px",
|
||||
position: 'relative',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
padding: '15px',
|
||||
},
|
||||
spacer: {
|
||||
height: "8px",
|
||||
height: '8px',
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -32,11 +32,11 @@ export function Profile() {
|
||||
// Annoyingling adding conditionals above this line to not render
|
||||
// when profile === null results in a react error that different
|
||||
// amounts of hooks are rendering
|
||||
const [avatarUrl, handleAvatarChange] = useState(profile.avatar_url || "");
|
||||
const [name, handleNameChange] = useState(profile.profile_name || "");
|
||||
const [bio, handleBioChange] = useState(profile.bio || "");
|
||||
const [location, handleLocationChange] = useState(profile.location || "");
|
||||
const [job, handleJobChange] = useState(profile.job || "");
|
||||
const [avatarUrl, handleAvatarChange] = useState(profile.avatar_url || '');
|
||||
const [name, handleNameChange] = useState(profile.profile_name || '');
|
||||
const [bio, handleBioChange] = useState(profile.bio || '');
|
||||
const [location, handleLocationChange] = useState(profile.location || '');
|
||||
const [job, handleJobChange] = useState(profile.job || '');
|
||||
|
||||
const handleUpdate = () => {
|
||||
const data = {
|
||||
@@ -46,7 +46,7 @@ export function Profile() {
|
||||
location,
|
||||
job,
|
||||
};
|
||||
Nui.send("phone:updateTwitterProfile", data);
|
||||
Nui.send('phone:updateTwitterProfile', data);
|
||||
};
|
||||
|
||||
// fetching the config is an asynchronous call so defend against it
|
||||
@@ -59,30 +59,30 @@ export function Profile() {
|
||||
{enableAvatars && <Avatar avatarUrl={avatarUrl} showInvalidImage />}
|
||||
<div className={classes.spacer} />
|
||||
<ProfileField
|
||||
label={t("APPS_TWITTER_EDIT_PROFILE_AVATAR")}
|
||||
label={t('APPS_TWITTER_EDIT_PROFILE_AVATAR')}
|
||||
value={avatarUrl}
|
||||
handleChange={handleAvatarChange}
|
||||
allowChange={enableAvatars}
|
||||
/>
|
||||
<ProfileField
|
||||
label={t("APPS_TWITTER_EDIT_PROFILE_NAME")}
|
||||
label={t('APPS_TWITTER_EDIT_PROFILE_NAME')}
|
||||
value={name}
|
||||
handleChange={handleNameChange}
|
||||
allowChange={allowEdtiableProfileName}
|
||||
/>
|
||||
<ProfileField
|
||||
label={t("APPS_TWITTER_EDIT_PROFILE_BIO")}
|
||||
label={t('APPS_TWITTER_EDIT_PROFILE_BIO')}
|
||||
value={bio}
|
||||
handleChange={handleBioChange}
|
||||
multiline
|
||||
/>
|
||||
<ProfileField
|
||||
label={t("APPS_TWITTER_EDIT_PROFILE_LOCATION")}
|
||||
label={t('APPS_TWITTER_EDIT_PROFILE_LOCATION')}
|
||||
value={location}
|
||||
handleChange={handleLocationChange}
|
||||
/>
|
||||
<ProfileField
|
||||
label={t("APPS_TWITTER_EDIT_PROFILE_JOB")}
|
||||
label={t('APPS_TWITTER_EDIT_PROFILE_JOB')}
|
||||
value={job}
|
||||
handleChange={handleJobChange}
|
||||
/>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import React from "react";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { TextField } from "@material-ui/core";
|
||||
import React from 'react';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { TextField } from '@material-ui/core';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
formContainer: {
|
||||
width: "100%",
|
||||
marginTop: "8px",
|
||||
width: '100%',
|
||||
marginTop: '8px',
|
||||
},
|
||||
textField: {
|
||||
width: "100%",
|
||||
width: '100%',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import React, { useState } from "react";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import React, { useState } from 'react';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import Nui from "../../../../os/nui-events/utils/Nui";
|
||||
import { useProfile } from "../../hooks/useProfile";
|
||||
import ProfileField from "./ProfileField";
|
||||
import ProfileUpdateButton from "../buttons/ProfileUpdateButton";
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useProfile } from '../../hooks/useProfile';
|
||||
import ProfileField from './ProfileField';
|
||||
import ProfileUpdateButton from '../buttons/ProfileUpdateButton';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
position: "relative",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
padding: "15px",
|
||||
position: 'relative',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
padding: '15px',
|
||||
},
|
||||
spacer: {
|
||||
height: "8px",
|
||||
height: '8px',
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -24,20 +24,20 @@ export function ProfilePrompt() {
|
||||
const { t } = useTranslation();
|
||||
const { profile } = useProfile();
|
||||
|
||||
const [name, handleNameChange] = useState(profile.profile_name || "");
|
||||
const [name, handleNameChange] = useState(profile.profile_name || '');
|
||||
|
||||
const handleUpdate = () => {
|
||||
const data = {
|
||||
...profile,
|
||||
profile_name: name,
|
||||
};
|
||||
Nui.send("phone:updateTwitterProfile", data);
|
||||
Nui.send('phone:updateTwitterProfile', data);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<ProfileField
|
||||
label={t("APPS_TWITTER_EDIT_PROFILE_NAME")}
|
||||
label={t('APPS_TWITTER_EDIT_PROFILE_NAME')}
|
||||
value={name}
|
||||
handleChange={handleNameChange}
|
||||
allowChange
|
||||
|
||||
Reference in new issue
Block a user