-
Notifications
You must be signed in to change notification settings - Fork 10
CAS-664: User Profile Page Layout #694
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
base: release-v2.0.0
Are you sure you want to change the base?
Conversation
| </> | ||
| ); | ||
| }; | ||
| export default ShareDropdown; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component is reused in the proposal copy and in the user profile
| } | ||
| }; | ||
|
|
||
| export default Tooltip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turning into TS
| defaultProps: {}, | ||
| }; | ||
|
|
||
| export default Button; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adds sizes for buttons based on designs
| } from '@chakra-ui/react'; | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| const CustomTab = forwardRef<HTMLElement, any>((props, ref) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add an interface above to define the props for the component instead of using any?
| {isSelected ? ( | ||
| <Svg name="Star" width="13" height="13" fill="black" /> | ||
| ) : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of ternary here you could use isSelected && <Svg />
| const twitterPost = `https://twitter.com/intent/tweet?text=${encodeURIComponent( | ||
| userVoted | ||
| ? `I just voted on ${proposalName} on CAST! ${proposalUrl}` | ||
| : `Check out ${proposalName} on CAST! ${proposalUrl}` | ||
| )} `; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just be
const twitterPost = userVoted
? `I just voted on ${proposalName} on CAST! ${proposalUrl}`
: `Check out ${proposalName} on CAST! ${proposalUrl}`
because below in the component you using the twitter intent url again
| </MenuButton> | ||
| <MenuList borderRadius="2xl" maxW="192px" minW="192px"> | ||
| <MenuItem display="flex" alignItems="center" minHeight="48px" pl={3}> | ||
| <CopyToClipboard text={copyString} onCopy={() => {}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should utilize useClipboard from Chakra instead this will allow us to remove react-copy-to-clipboard
| const profileUrl = `${FRONTEND_URL}/#/profile?addr=${userAddr}`; | ||
|
|
||
| const twitterPost = `https://twitter.com/intent/tweet?text=${encodeURIComponent( | ||
| `Check at my profile in ${profileUrl} on CAST! ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `Check at my profile in ${profileUrl} on CAST! ` | |
| `Check at my profile on CAST! ${profileUrl}` |
Check with product they may have better copy that we can use for the tweet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here as well I don't think you need the url in the string because ShareDropdown uses the twitter url and encodes the string passed to the component
| alwaysVisible={true} | ||
| enabled={addressCopied} | ||
| > | ||
| <CopyToClipboard text={addr} onCopy={markAddressCopied}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here maybe we can utilize useClipboard from Chakra
| const UserProfile: React.FC = () => { | ||
| const { | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you use // @ts-expect-error: Enter reason here then you don't need the eslint disable and we will have a documented reason why for why we need to ignore the line
Creates

/profilepage. When loading page from another user url will be/profile?addr=someAddrDesktop:
Mobile:

Copy does:

Copy Link does:
