mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
styling(misc): Misc. Tweaks and gen styling changes
General Phone: - Removed unecessary border that was causing an issue at 80% zoom - Added tooltips to the app grid - Added 4 new backgrounds Contact App: - Fix styling issue that lead to seeing the background from modal - Fix add new contact button sticky position Notes: - Removed padding from list - Fixed localeName Sellout: - Changed NavBar and Title Color Settings: - Removed modal list padding Note: Let me if you prefer the AppTitle component vs the old Title method also this is just a start to the full app restyles
This commit is contained in:
1 parent
f7165bf9ae
commit
954ef6277c
18 files changed
+316
-291
No files matched your search
@@ -1,25 +1,25 @@
|
||||
import React from "react";
|
||||
import { AppWrapper } from "../../../ui/components";
|
||||
import { makeStyles, createStyles, Theme } from "@material-ui/core/styles";
|
||||
import { AppTitle } from "../../../ui/components/AppTitle";
|
||||
import { AppContent } from "../../../ui/components/AppContent";
|
||||
import { ContactList } from "./List/ContactList";
|
||||
import { useApp } from "../../../os/apps/hooks/useApps";
|
||||
import { AddContactModal } from "./ContactModal";
|
||||
import { useModal } from "../hooks/useModal";
|
||||
import { SearchContacts } from "./List/SearchContacts";
|
||||
import PersonAddIcon from "@material-ui/icons/PersonAdd";
|
||||
import Fab from "@material-ui/core/Fab";
|
||||
import { useContactModal } from "../hooks/useContactModal";
|
||||
import { InfoModal } from "./modal/InfoModal";
|
||||
import { useContactDetail } from "../hooks/useContactDetail";
|
||||
import React from 'react';
|
||||
import { AppWrapper } from '../../../ui/components';
|
||||
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
|
||||
import { AppTitle } from '../../../ui/components/AppTitle';
|
||||
import { AppContent } from '../../../ui/components/AppContent';
|
||||
import { ContactList } from './List/ContactList';
|
||||
import { useApp } from '../../../os/apps/hooks/useApps';
|
||||
import { AddContactModal } from './ContactModal';
|
||||
import { useModal } from '../hooks/useModal';
|
||||
import { SearchContacts } from './List/SearchContacts';
|
||||
import PersonAddIcon from '@material-ui/icons/PersonAdd';
|
||||
import Fab from '@material-ui/core/Fab';
|
||||
import { useContactModal } from '../hooks/useContactModal';
|
||||
import { InfoModal } from './modal/InfoModal';
|
||||
import { useContactDetail } from '../hooks/useContactDetail';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
backgroundModal: {
|
||||
background: "black",
|
||||
opacity: "0.6",
|
||||
position: "absolute",
|
||||
background: 'black',
|
||||
opacity: '0.6',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
@@ -27,9 +27,9 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||
zIndex: 5,
|
||||
},
|
||||
absolute: {
|
||||
position: "sticky",
|
||||
position: 'absolute',
|
||||
bottom: theme.spacing(2),
|
||||
left: theme.spacing(3),
|
||||
right: theme.spacing(3),
|
||||
},
|
||||
})
|
||||
);
|
||||
@@ -37,7 +37,7 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||
export const ContactsApp = () => {
|
||||
const classes = useStyles();
|
||||
const { showModal, setShowModal } = useModal();
|
||||
const contacts = useApp("CONTACTS");
|
||||
const contacts = useApp('CONTACTS');
|
||||
const { contactDetail } = useContactDetail();
|
||||
|
||||
const openModal = () => {
|
||||
@@ -45,7 +45,7 @@ export const ContactsApp = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<AppWrapper id="contact-app">
|
||||
<AppWrapper id='contact-app'>
|
||||
<AppTitle app={contacts}></AppTitle>
|
||||
<SearchContacts />
|
||||
<AddContactModal />
|
||||
@@ -55,7 +55,7 @@ export const ContactsApp = () => {
|
||||
<ContactList />
|
||||
<Fab
|
||||
onClick={openModal}
|
||||
style={{ backgroundColor: "#2196f3", color: "#fff" }}
|
||||
style={{ backgroundColor: '#2196f3', color: '#fff' }}
|
||||
className={classes.absolute}
|
||||
>
|
||||
<PersonAddIcon />
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import React, { useState } from "react";
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Paper,
|
||||
Slide,
|
||||
Button,
|
||||
TextField,
|
||||
Avatar as MuiAvatar,
|
||||
} from "@material-ui/core";
|
||||
import useStyles from "./modal.styles";
|
||||
import { useContactModal } from "../../hooks/useContactModal";
|
||||
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
|
||||
} from '@material-ui/core';
|
||||
import useStyles from './modal.styles';
|
||||
import { useContactModal } from '../../hooks/useContactModal';
|
||||
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useContactDetail } from "../../hooks/useContactDetail";
|
||||
import Nui from "../../../../os/nui-events/utils/Nui";
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useContactDetail } from '../../hooks/useContactDetail';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
|
||||
export const InfoModal = () => {
|
||||
const classes = useStyles();
|
||||
@@ -21,14 +21,14 @@ export const InfoModal = () => {
|
||||
const { contactDetail, setContactDetail } = useContactDetail();
|
||||
|
||||
const [display, setDisplay] = useState(
|
||||
contactDetail ? contactDetail.display : ""
|
||||
contactDetail ? contactDetail.display : ''
|
||||
);
|
||||
console.log(contactDetail);
|
||||
const [number, setNumber] = useState(
|
||||
contactDetail ? contactDetail.number : ""
|
||||
contactDetail ? contactDetail.number : ''
|
||||
);
|
||||
const [avatar, setAvatar] = useState(
|
||||
contactDetail ? contactDetail.avatar : ""
|
||||
contactDetail ? contactDetail.avatar : ''
|
||||
);
|
||||
|
||||
const closeModal = () => {
|
||||
@@ -37,7 +37,7 @@ export const InfoModal = () => {
|
||||
};
|
||||
|
||||
const updateContact = () => {
|
||||
Nui.send("phone:updateContact", {
|
||||
Nui.send('phone:updateContact', {
|
||||
id: contactDetail.id,
|
||||
display,
|
||||
number,
|
||||
@@ -48,7 +48,7 @@ export const InfoModal = () => {
|
||||
};
|
||||
|
||||
const deleteContact = () => {
|
||||
Nui.send("phone:deleteContact", {
|
||||
Nui.send('phone:deleteContact', {
|
||||
id: contactDetail.id,
|
||||
});
|
||||
setContactDetail(null);
|
||||
@@ -56,9 +56,10 @@ export const InfoModal = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Slide direction="up" in={showContactModal}>
|
||||
<Slide direction='up' in={showContactModal}>
|
||||
<Paper
|
||||
className={showContactModal ? classes.modalRoot : classes.modalHide}
|
||||
square
|
||||
>
|
||||
<Button style={{ margin: 10 }} onClick={closeModal}>
|
||||
<ArrowBackIcon />
|
||||
@@ -69,7 +70,7 @@ export const InfoModal = () => {
|
||||
className={classes.input}
|
||||
value={display}
|
||||
onChange={(e) => setDisplay(e.target.value)}
|
||||
placeholder={t("APPS_CONTACT_FORM_NAME")}
|
||||
placeholder={t('APPS_CONTACT_FORM_NAME')}
|
||||
fullWidth
|
||||
inputProps={{
|
||||
className: classes.inputProps,
|
||||
@@ -79,7 +80,7 @@ export const InfoModal = () => {
|
||||
className={classes.input}
|
||||
value={number}
|
||||
onChange={(e) => setNumber(e.target.value)}
|
||||
placeholder={t("APPS_CONTACT_FORM_NUMBER")}
|
||||
placeholder={t('APPS_CONTACT_FORM_NUMBER')}
|
||||
fullWidth
|
||||
inputProps={{
|
||||
className: classes.inputProps,
|
||||
@@ -87,7 +88,7 @@ export const InfoModal = () => {
|
||||
/>
|
||||
<TextField
|
||||
className={classes.input}
|
||||
placeholder={t("APPS_CONTACT_FORM_AVATAR")}
|
||||
placeholder={t('APPS_CONTACT_FORM_AVATAR')}
|
||||
fullWidth
|
||||
value={avatar}
|
||||
onChange={(e) => setAvatar(e.target.value)}
|
||||
@@ -96,7 +97,7 @@ export const InfoModal = () => {
|
||||
}}
|
||||
/>
|
||||
|
||||
<div style={{ display: "block" }}>
|
||||
<div style={{ display: 'block' }}>
|
||||
<Button onClick={updateContact} className={classes.updateButton}>
|
||||
Update
|
||||
</Button>
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
import React from "react";
|
||||
import { AppWrapper } from "../../ui/components/AppWrapper";
|
||||
import { AppContent } from "../../ui/components/AppContent";
|
||||
import NotesTitle from "./NotesTitle";
|
||||
import NoteList from "./list/NoteList";
|
||||
import React from 'react';
|
||||
import { AppWrapper } from '../../ui/components/AppWrapper';
|
||||
import { AppContent } from '../../ui/components/AppContent';
|
||||
import { AppTitle } from '../../ui/components/AppTitle';
|
||||
import { useApp } from '../../os/apps/hooks/useApps';
|
||||
import NoteList from './list/NoteList';
|
||||
|
||||
import { useNotes } from "./hooks/useNotes";
|
||||
import { NoteModal } from "./modal/NoteModal";
|
||||
import { Fab } from "@material-ui/core";
|
||||
import AddIcon from "@material-ui/icons/Add";
|
||||
import { useNotes } from './hooks/useNotes';
|
||||
import { NoteModal } from './modal/NoteModal';
|
||||
import { Fab } from '@material-ui/core';
|
||||
import AddIcon from '@material-ui/icons/Add';
|
||||
|
||||
import { useNoteModal } from "./hooks/useNoteModal";
|
||||
import { useNoteDetail } from "./hooks/useNoteDetail";
|
||||
import { useNoteModal } from './hooks/useNoteModal';
|
||||
import { useNoteDetail } from './hooks/useNoteDetail';
|
||||
|
||||
import useStyles from "./notes.styles";
|
||||
import useStyles from './notes.styles';
|
||||
|
||||
export const NotesApp = () => {
|
||||
const { setNoteModal } = useNoteModal();
|
||||
const { detail, setDetail } = useNoteDetail();
|
||||
const notes = useNotes();
|
||||
const notesApp = useApp('NOTES');
|
||||
|
||||
const classes = useStyles();
|
||||
|
||||
@@ -27,8 +29,8 @@ export const NotesApp = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<AppWrapper id="notes-app">
|
||||
<NotesTitle />
|
||||
<AppWrapper id='notes-app'>
|
||||
<AppTitle app={notesApp} />
|
||||
<NoteModal key={detail?.id} />
|
||||
<AppContent>
|
||||
<NoteList notes={notes} />
|
||||
@@ -36,8 +38,8 @@ export const NotesApp = () => {
|
||||
className={classes.absolute}
|
||||
onClick={handleModal}
|
||||
style={{
|
||||
background: "#f9a825",
|
||||
color: "#fff",
|
||||
background: '#f9a825',
|
||||
color: '#fff',
|
||||
}}
|
||||
>
|
||||
<AddIcon />
|
||||
|
||||
@@ -1,28 +1,34 @@
|
||||
import { List, ListItem, ListItemText } from '@material-ui/core';
|
||||
import React, { useState } from 'react'
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import { useNoteModal } from '../hooks/useNoteModal';
|
||||
import { useNoteDetail } from '../hooks/useNoteDetail';
|
||||
|
||||
// add search bar later
|
||||
const NoteList = ({notes}) => {
|
||||
// TODO: Add interface for note
|
||||
const NoteList = ({ notes }) => {
|
||||
const { setNoteModal } = useNoteModal();
|
||||
const { setDetail } = useNoteDetail();
|
||||
|
||||
const handleNoteModal = (note) => {
|
||||
setNoteModal(true)
|
||||
setDetail(note)
|
||||
}
|
||||
setNoteModal(true);
|
||||
setDetail(note);
|
||||
};
|
||||
|
||||
return (
|
||||
<List>
|
||||
<List disablePadding>
|
||||
{notes.map((note) => (
|
||||
<ListItem key={note.id} button divider onClick={() => handleNoteModal(note)}>
|
||||
<ListItemText><strong>{note.title}</strong></ListItemText>
|
||||
<ListItem
|
||||
key={note.id}
|
||||
button
|
||||
divider
|
||||
onClick={() => handleNoteModal(note)}
|
||||
>
|
||||
<ListItemText>{note.title}</ListItemText>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
export default NoteList;
|
||||
@@ -1,25 +1,22 @@
|
||||
import {
|
||||
Button,
|
||||
TextField,
|
||||
Slide,
|
||||
} from "@material-ui/core";
|
||||
import React, { useState } from "react";
|
||||
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
|
||||
import { Button, TextField, Slide } from '@material-ui/core';
|
||||
import React, { useState } from 'react';
|
||||
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||
|
||||
import { useNoteModal } from "../hooks/useNoteModal";
|
||||
import { useNoteDetail } from "../hooks/useNoteDetail";
|
||||
import { useNoteModal } from '../hooks/useNoteModal';
|
||||
import { useNoteDetail } from '../hooks/useNoteDetail';
|
||||
|
||||
import useStyles from "./modal.styles";
|
||||
import useStyles from './modal.styles';
|
||||
|
||||
import "../NotesApp.css";
|
||||
import Nui from "../../../os/nui-events/utils/Nui";
|
||||
import '../NotesApp.css';
|
||||
import Nui from '../../../os/nui-events/utils/Nui';
|
||||
|
||||
// TODO: Fix input focus color
|
||||
export const NoteModal = () => {
|
||||
const { noteModal, setNoteModal } = useNoteModal();
|
||||
const { detail, setDetail } = useNoteDetail();
|
||||
console.log(detail);
|
||||
const [title, setTitle] = useState(detail ? detail.title : "");
|
||||
const [content, setContent] = useState(detail ? detail.content : "");
|
||||
const [title, setTitle] = useState(detail ? detail.title : '');
|
||||
const [content, setContent] = useState(detail ? detail.content : '');
|
||||
|
||||
const classes = useStyles();
|
||||
|
||||
@@ -31,7 +28,7 @@ export const NoteModal = () => {
|
||||
const handleNoteSave = () => {
|
||||
setNoteModal(false);
|
||||
setDetail(null);
|
||||
Nui.send("phone:addNote", {
|
||||
Nui.send('phone:addNote', {
|
||||
title,
|
||||
content,
|
||||
});
|
||||
@@ -40,14 +37,14 @@ export const NoteModal = () => {
|
||||
const handleDeleteNote = () => {
|
||||
const id = detail.id;
|
||||
setNoteModal(false);
|
||||
Nui.send("phone:deleteNote", {
|
||||
Nui.send('phone:deleteNote', {
|
||||
id,
|
||||
});
|
||||
setDetail(null);
|
||||
};
|
||||
|
||||
const handleUpdateNote = () => {
|
||||
Nui.send("phone:updateNote", {
|
||||
Nui.send('phone:updateNote', {
|
||||
id: detail.id,
|
||||
title,
|
||||
content,
|
||||
@@ -58,15 +55,15 @@ export const NoteModal = () => {
|
||||
|
||||
return (
|
||||
<div className={noteModal ? classes.modalRoot : classes.modalHide}>
|
||||
<Slide direction="left" in={noteModal} mountOnEnter unmountOnExit>
|
||||
<Slide direction='left' in={noteModal} mountOnEnter unmountOnExit>
|
||||
<div>
|
||||
<Button className={classes.closeButton} onClick={_handleClose}>
|
||||
<ArrowBackIcon />
|
||||
</Button>
|
||||
<div id="notes-modal" className={classes.noteContainer}>
|
||||
<div id='notes-modal' className={classes.noteContainer}>
|
||||
<TextField
|
||||
className={classes.input}
|
||||
placeholder="Title"
|
||||
placeholder='Title'
|
||||
inputProps={{
|
||||
className: classes.inputPropsTitle,
|
||||
}}
|
||||
@@ -79,11 +76,11 @@ export const NoteModal = () => {
|
||||
inputProps={{
|
||||
className: classes.inputPropsContent,
|
||||
}}
|
||||
placeholder="Content"
|
||||
placeholder='Content'
|
||||
multiline
|
||||
fullWidth
|
||||
rows={19}
|
||||
variant="outlined"
|
||||
variant='outlined'
|
||||
value={content}
|
||||
onChange={(e) => setContent(e.target.value)}
|
||||
/>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import React from "react";
|
||||
import Paper from "@material-ui/core/Paper";
|
||||
import { makeStyles } from "@material-ui/core";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faAd } from "@fortawesome/free-solid-svg-icons";
|
||||
import React from 'react';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faAd } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
height: "60px",
|
||||
width: "100%",
|
||||
display: "flex",
|
||||
flexFlow: "row nowrap",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
background: "#424242",
|
||||
height: '60px',
|
||||
width: '100%',
|
||||
display: 'flex',
|
||||
flexFlow: 'row nowrap',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
background: '#262525',
|
||||
},
|
||||
icon: {
|
||||
color: "#f44336",
|
||||
color: '#f44336',
|
||||
fontSize: 40,
|
||||
},
|
||||
}));
|
||||
@@ -23,7 +23,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
export const SelloutTitle = () => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Paper className={classes.root} square variant="outlined" elevation={24}>
|
||||
<Paper className={classes.root} square variant='outlined' elevation={24}>
|
||||
<FontAwesomeIcon icon={faAd} className={classes.icon} />
|
||||
</Paper>
|
||||
);
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
import React, { useState } from "react";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { Link } from "react-router-dom";
|
||||
import { BottomNavigation, BottomNavigationAction } from "@material-ui/core";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faHome } from "@fortawesome/free-solid-svg-icons";
|
||||
import AddCircleIcon from "@material-ui/icons/AddCircle";
|
||||
import React, { useState } from 'react';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faHome } from '@fortawesome/free-solid-svg-icons';
|
||||
import AddCircleIcon from '@material-ui/icons/AddCircle';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
width: "100%",
|
||||
width: '100%',
|
||||
backgroundColor: '#262525',
|
||||
},
|
||||
icon: {
|
||||
color: "#f44336",
|
||||
color: '#f44336',
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -30,12 +31,12 @@ export const NavigationBar = () => {
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faHome} />}
|
||||
to="/sellout"
|
||||
to='/sellout'
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<AddCircleIcon />}
|
||||
to="/sellout/new"
|
||||
to='/sellout/new'
|
||||
/>
|
||||
</BottomNavigation>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user