Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

237 edit profile picture and name #462

Merged
merged 39 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e2811eb
2.0.1
mikozet Jul 6, 2022
88a4f17
Remove unused dragonfly icon
louilinn Jul 4, 2022
29711d5
Update translations
mikozet Jul 18, 2022
21a56a7
Add edit route
mikozet Jul 18, 2022
0bd31de
Remove title as required prop from DialogInfo
mikozet Jul 18, 2022
ce19d29
Add Edit profile link in NavigationFloating
mikozet Jul 18, 2022
7496ccb
Add edit, uploadPhoto icons
mikozet Jul 18, 2022
63f4583
Add edit profile icon in Share component
mikozet Jul 18, 2022
6a63aee
Add icon files
mikozet Jul 18, 2022
74fa117
Add EditProfile component
mikozet Jul 18, 2022
b811dcc
Add image url prop for Avatar component
mikozet Jul 22, 2022
b3cde8b
Create ImageCapture component for capturing pictures from device camera
mikozet Jul 22, 2022
8de23db
Add UploadFromCamera component
mikozet Jul 22, 2022
a635b3f
Add edit profile component
mikozet Jul 22, 2022
0ed969d
Update translations
mikozet Jul 22, 2022
8b76f70
Merge branch 'development' of github.com:CirclesUBI/circles-myxogastr…
mikozet Jul 27, 2022
ebdb72d
Update DialogInfo component so it can be fullwidth
mikozet Jul 29, 2022
3d70d44
Add update method for user in core services
mikozet Jul 29, 2022
d905ea3
Add deviceDetect method to recognise between desktop and mobile
mikozet Jul 29, 2022
044d931
Update translations, save edit profile
mikozet Jul 29, 2022
1ca9e75
Update translations
mikozet Aug 11, 2022
0ceb1cf
Add isBtnClose prop
mikozet Aug 11, 2022
65003ee
Add theme variables
mikozet Aug 11, 2022
57b6244
Add getEmail to core
mikozet Aug 11, 2022
4ad689e
Change cursor when hovering avatar
mikozet Aug 11, 2022
d13c6d3
Update UploadFromCamera
mikozet Aug 11, 2022
8dbb9e5
Update ImageCapture
mikozet Aug 11, 2022
ab57368
Update Edit Profile
mikozet Aug 11, 2022
5cdea6c
Upadate package.json
mikozet Aug 11, 2022
3a5445f
Add useCache attribute to useUserdata
mikozet Aug 17, 2022
af05746
Add allowCurrentUser as input value for username input
mikozet Aug 17, 2022
4fd5289
Update user info - components values after change
mikozet Aug 17, 2022
9561f7b
Update translations
mikozet Aug 17, 2022
640a178
Without border option for buttons
mikozet Aug 17, 2022
6041c7f
Update components with design
mikozet Aug 17, 2022
365fa46
Update edit profile
mikozet Aug 17, 2022
148e65e
Make lint happy
llunaCreixent Aug 18, 2022
2ea6e6d
Update translations
mikozet Aug 18, 2022
ba21fdd
Merge branch '237-edit-profile-picture-and-name' of github.com:Circle…
mikozet Aug 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions assets/images/dragonfly2.svg

This file was deleted.

1 change: 1 addition & 0 deletions assets/images/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions assets/images/uploadPhoto.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,26 @@
"buttonClose": "Close",
"buttonDonate": "Donate now"
},
"EditProfile": {
"bodyCancel": "If you click cancel all changes you made will be lost.",
"buttonCancel": "Cancel",
"buttonContinue": "Continue Editing",
"buttonSave": "Save changes",
"charactersExplanation": "Only basic characters and numbers (A-Z, 0-9) are allowed, no symbols or whitespace, 3-24 characters",
"confirmationMessage": "Great! Your profile changes have been saved!",
"errorNameTaken": "Sorry, this name is already taken!",
"errorInvalidName": "Ups! Invalid name, try again.",
"errorImageCapture": "Sorry, there was a problem with image capture.",
"errorSaveChanges": "Sorry, there was a problem with saving changes.",
"heading": "Edit profile",
"optionCapture": "Capture",
"optionTryAgain": "Try Again",
"optionCamera": "Camera",
"optionUpload": "Upload",
"optionFile": "Gallery",
"titleCancel": "Do you want to save changes to your profile?",
"usernameExplanation": "Your username is how your friends can search for you on the Circles App."
},
"Finder": {
"bodyFilterDirect": "Directly trusted",
"bodyFilterExternal": "External",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "circles-myxogastria",
"version": "2.0.0",
"version": "2.0.1",
mikozet marked this conversation as resolved.
Show resolved Hide resolved
"description": "Webapp and mobile client for Circles",
"main": "src/index.js",
"private": true,
Expand Down Expand Up @@ -57,7 +57,7 @@
"webpack-dev-server": "^3.11.2"
},
"dependencies": {
"@circles/core": "^2.10.10",
"@circles/core": "^2.12.0",
"@circles/timecircles": "^1.0.6",
"@material-ui/core": "^4.12.4",
"@material-ui/lab": "^4.0.0-alpha.61",
Expand Down
10 changes: 8 additions & 2 deletions src/components/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const useStyles = makeStyles(() => ({
avatarContainer: {
position: 'relative',
margin: '0 auto',
cursor: 'pointer',
},
organizationIndicator: {
position: 'absolute',
Expand All @@ -29,11 +30,14 @@ const useStyles = makeStyles(() => ({
},
}));

const Avatar = ({ address, size = 'small', ...props }) => {
const Avatar = ({ address, size = 'small', url, useCache, ...props }) => {
const classes = useStyles();
const theme = useTheme();

const { avatarUrl, username } = useUserdata(address);
let { avatarUrl, username } = useUserdata(address, useCache);

if (url) avatarUrl = url;

const { isOrganization } = useIsOrganization(address);

const sizePixelAvatar =
Expand Down Expand Up @@ -68,6 +72,8 @@ const Avatar = ({ address, size = 'small', ...props }) => {
Avatar.propTypes = {
address: PropTypes.string,
size: PropTypes.string,
url: PropTypes.string,
useCache: PropTypes.bool,
};

export default React.memo(Avatar);
5 changes: 3 additions & 2 deletions src/components/AvatarHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ const AvatarHeader = ({ hideImage, username }) => {
const displayedUsername = username ? (
`@${username}`
) : safe.currentAccount ? (
<UsernameDisplay address={safe.currentAccount} />
<UsernameDisplay address={safe.currentAccount} useCache={false} />
) : safe.pendingAddress ? (
<UsernameDisplay address={safe.pendingAddress} />
<UsernameDisplay address={safe.pendingAddress} useCache={false} />
) : null;

return (
Expand All @@ -56,6 +56,7 @@ const AvatarHeader = ({ hideImage, username }) => {
address={safe.currentAccount || safe.pendingAddress}
className={classes.avatarContainer}
size={'smallXl'}
useCache={false}
/>
</Link>
)}
Expand Down
14 changes: 14 additions & 0 deletions src/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ const useStyles = makeStyles((theme) => ({
linear-gradient(to right, ${theme.custom.colors.purple}, ${theme.custom.colors.purpleDark}) border-box`,
border: '1px solid transparent',
},
buttonWithoutBorder: {
border: 0,
background: theme.custom.gradients.purple,
backgroundClip: 'text',
color: 'transparent',
'-webkit-background-clip': 'text',
'-webkit-text-fill-color': 'transparent',
'&:hover': {
backgroundColor: 'transparent',
},
},
}));

// eslint-disable-next-line react/display-name
Expand All @@ -68,6 +79,7 @@ const Button = React.forwardRef(
isWhite,
isWhiteText,
isGradientBorder,
isWithoutBorder,
to,
...props
},
Expand All @@ -83,6 +95,7 @@ const Button = React.forwardRef(
[classes.buttonWhite]: isWhite,
[classes.buttonWhiteText]: isWhiteText,
[classes.buttonGradientBorder]: isGradientBorder,
[classes.buttonWithoutBorder]: isWithoutBorder,
});

return React.createElement(
Expand Down Expand Up @@ -113,6 +126,7 @@ Button.propTypes = {
isPrimary: PropTypes.bool,
isWhite: PropTypes.bool,
isWhiteText: PropTypes.bool,
isWithoutBorder: PropTypes.bool,
onClick: PropTypes.func,
to: PropTypes.string,
};
Expand Down
22 changes: 18 additions & 4 deletions src/components/DialogInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,46 @@ const useStyles = makeStyles((theme) => ({
},
}));

const DialogInfo = ({ dialogContent, handleClose, id, isOpen, title }) => {
const DialogInfo = ({
dialogContent,
handleClose,
id,
isOpen,
title,
fullWidth,
maxWidth,
isBtnClose = true,
}) => {
const classes = useStyles();

return (
<MuiDialog
aria-describedby={`dialog-${id}-text`}
aria-labelledby={`dialog-${id}-description`}
className={classes.dialogContainer}
fullWidth={fullWidth}
maxWidth={maxWidth}
open={isOpen}
onClose={handleClose}
>
<DialogTitle id={`dialog-${id}-title`}>{title}</DialogTitle>
<DialogContent>{dialogContent}</DialogContent>
<DialogActions style={{ justifyContent: 'center' }}>
<ButtonClose onClick={handleClose} />
{isBtnClose && <ButtonClose onClick={handleClose} />}
</DialogActions>
</MuiDialog>
);
};

DialogInfo.propTypes = {
dialogContent: PropTypes.element,
fullWidth: PropTypes.bool,
handleClose: PropTypes.func.isRequired,
id: PropTypes.string.isRequired,
id: PropTypes.string,
isBtnClose: PropTypes.bool,
isOpen: PropTypes.bool.isRequired,
title: PropTypes.string.isRequired,
maxWidth: PropTypes.string,
title: PropTypes.string,
};

export default React.memo(DialogInfo);
Loading