mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Feature/tinder (#179)
* basic framework for match/tinder * working version of swiping * working version of profile editing * introducing backend * working matching system * working profile updating * fix all linting issues * updated events to Enum * working profile generation * documentation updates * general PR feedback * working profile loading, matches show matchedAt * slight modification to event strings * added sql imports
This commit is contained in:
46 files changed
+1932
-49
No files matched your search
@@ -0,0 +1,45 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { Box, FormControlLabel, Switch } from '@material-ui/core';
|
||||
|
||||
import { useProfile } from '../../hooks/useProfile';
|
||||
import Loader from '../Loader';
|
||||
import ProfileForm from '../profile/ProfileForm';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
root: {
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
},
|
||||
switch: {
|
||||
marginLeft: '15px',
|
||||
},
|
||||
});
|
||||
|
||||
function ProfileEditor() {
|
||||
const { profile, noProfileExists } = useProfile();
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const [showPreview, setShowPreview] = useState(false);
|
||||
|
||||
const toggleSwitch = () => {
|
||||
setShowPreview((preview) => !preview);
|
||||
};
|
||||
|
||||
if (!profile && !noProfileExists) return <Loader />;
|
||||
|
||||
return (
|
||||
<Box className={classes.root}>
|
||||
<Box className={classes.switch}>
|
||||
<FormControlLabel
|
||||
control={<Switch checked={showPreview} onChange={toggleSwitch} />}
|
||||
label={t('APPS_MATCH_EDIT_PROFILE_PREVIEW')}
|
||||
/>
|
||||
</Box>
|
||||
<ProfileForm showPreview={showPreview} profile={profile} />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
export default ProfileEditor;
|
||||
Reference in new issue
Block a user