Skip to content

Commit

Permalink
Adjust help & settings pages to design
Browse files Browse the repository at this point in the history
  • Loading branch information
serjonya-trili committed Oct 23, 2023
1 parent 09e62a9 commit d42ee94
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 90 deletions.
3 changes: 1 addition & 2 deletions src/assets/icons/ChevronDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import colors from "../../style/colors";
const ChevronDownIcon: React.FC<IconProps> = props => {
return (
<Icon
data-testid="baker-icon"
width="18px"
height="18px"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
stroke={colors.gray[450]}
{...props}
>
<path
d="M4.5 6.75L9 11.25L13.5 6.75"
stroke={colors.gray[450]}
strokeWidth="1.2"
strokeLinecap="round"
strokeLinejoin="round"
Expand Down
42 changes: 24 additions & 18 deletions src/components/ClickableCard.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
import { Card, CardBody, Flex, Heading, LayoutProps } from "@chakra-ui/react";
import { Card, CardBody, CardProps, Flex, Heading } from "@chakra-ui/react";
import colors from "../style/colors";
import { ChevronRightIcon } from "@chakra-ui/icons";

const ClickableCard: React.FC<{
onClick?: () => void;
h?: LayoutProps["h"];
children: React.ReactNode;
}> = ({ onClick, h, children }) => {
const ClickableCard: React.FC<
{
onClick?: () => void;
children: React.ReactNode;
isSelected: boolean;
} & CardProps
> = ({ onClick, children, isSelected, ...props }) => {
return (
<Card
paddingX={1}
marginY={2}
height="66px"
padding="24px"
marginBottom="10px"
bgColor={colors.gray[900]}
borderRadius="lg"
border="1px solid"
borderColor={isSelected ? ` ${colors.orangeL}` : "transparent"}
_hover={{ border: `1px solid ${colors.gray[500]}`, bg: colors.gray[800] }}
justifyContent="center"
cursor={onClick ? "pointer" : undefined}
h={h}
onClick={onClick}
{...props}
>
<CardBody onClick={onClick}>{children}</CardBody>
<CardBody padding={0}>{children}</CardBody>
</Card>
);
};
Expand All @@ -26,9 +33,10 @@ export const SettingsCard: React.FC<{
left: string;
onClick?: () => void;
children: React.ReactNode;
}> = ({ left, onClick, children }) => {
isSelected: boolean;
}> = ({ left, onClick, isSelected, children }) => {
return (
<ClickableCard onClick={onClick} h="66px">
<ClickableCard onClick={onClick} isSelected={isSelected}>
<Flex alignItems="center" h="100%">
<Flex justifyContent="space-between" alignItems="center" w="100%">
<Heading size="sm">{left}</Heading>
Expand All @@ -41,19 +49,17 @@ export const SettingsCard: React.FC<{

export const SettingsCardWithDrawerIcon: React.FC<{
left: string;
isSelected: boolean;
onClick?: () => void;
}> = ({ left, onClick }) => {
}> = ({ left, isSelected, onClick }) => {
return (
<SettingsCard left={left} onClick={onClick}>
<SettingsCard left={left} onClick={onClick} isSelected={isSelected}>
<ChevronRightIcon
viewBox="0 0 18 18"
height="18px"
width="18px"
marginTop="-3px"
color={colors.gray[450]}
_hover={{
color: colors.gray[300],
}}
stroke={colors.gray[450]}
/>
</SettingsCard>
);
Expand Down
104 changes: 44 additions & 60 deletions src/views/help/HelpView.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Flex, Grid, GridItem } from "@chakra-ui/layout";
import { Box, Text, Divider, Heading, Icon } from "@chakra-ui/react";
import { FiExternalLink } from "react-icons/fi";
import { Box, Text, Heading, Center } from "@chakra-ui/react";
import React from "react";
import { TopBar } from "../../components/TopBar";
import colors from "../../style/colors";
import ClickableCard from "../../components/ClickableCard";
import ClickableCard, { SettingsCard } from "../../components/ClickableCard";
import { navigateToExternalLink } from "../../utils/helpers";
import ExternalLinkIcon from "../../assets/icons/ExternalLink";

export default function HelpView() {
return (
Expand Down Expand Up @@ -52,50 +52,39 @@ export default function HelpView() {
/>
</HelpCard>

<HelpCard title="Need Help?">
<Box>
<Flex justifyContent="space-between" alignItems="center">
<Heading size="sm">Contact our Support Team</Heading>
<Flex
alignItems="center"
color={colors.gray[400]}
_hover={{
color: colors.gray[300],
}}
cursor="pointer"
onClick={() => navigateToExternalLink("mailto:[email protected]")}
>
<Text size="sm">[email protected]</Text>
<Icon as={FiExternalLink} ml={2} />
</Flex>
</Flex>

<Box marginY={4}>
<Divider orientation="horizontal" size="lg" />
</Box>

<Flex justifyContent="space-between" alignItems="center">
<Heading size="sm">Get in touch with the Community</Heading>

<Flex
alignItems="center"
color={colors.gray[400]}
_hover={{
color: colors.gray[300],
}}
cursor="pointer"
onClick={() =>
navigateToExternalLink(
"https://join.slack.com/t/tezos-dev/shared_invite/zt-1ur1ymxrp-G_X_bFHrvWXwoeiy53J8lg"
)
}
>
<Text size="sm">Slack #Umami</Text>
<Icon as={FiExternalLink} ml={2} />
</Flex>
</Flex>
</Box>
</HelpCard>
<Box w="550px" data-testid="help-card">
<Heading size="lg" mb="16px">
Need Help?
</Heading>
<SettingsCard
left="Contact our Support Team"
onClick={() => navigateToExternalLink("mailto:[email protected]")}
isSelected={false}
>
<Center>
<Text size="sm" color={colors.gray[300]}>
[email protected]
</Text>
<ExternalLinkIcon ml="4px" />
</Center>
</SettingsCard>
<SettingsCard
isSelected={false}
left="Get in touch with the Community"
onClick={() =>
navigateToExternalLink(
"https://join.slack.com/t/tezos-dev/shared_invite/zt-1ur1ymxrp-G_X_bFHrvWXwoeiy53J8lg"
)
}
>
<Center>
<Text size="sm" color={colors.gray[300]}>
Slack #Umami
</Text>
<ExternalLinkIcon ml="4px" />
</Center>
</SettingsCard>
</Box>

<HelpCard
title="Terms of Use"
Expand Down Expand Up @@ -138,16 +127,7 @@ const HelpLinkRow: React.FC<{
{linkDescription}
</Text>
)}
<Icon
cursor="pointer"
color={colors.gray[600]}
as={FiExternalLink}
_hover={{
color: colors.gray[300],
}}
onClick={onClickIcon}
ml={2}
/>
<ExternalLinkIcon />
</Flex>
</Flex>
);
Expand All @@ -159,11 +139,15 @@ const HelpCard: React.FC<{
children: React.ReactNode;
}> = ({ title, onClick, children }) => {
return (
<Box marginY={2} data-testid="help-card">
<Box marginY="10px" data-testid="help-card">
<Flex>
<Box w="550px">
<Heading size="lg">{title}</Heading>
<ClickableCard onClick={onClick}>{children}</ClickableCard>
<Heading size="lg" mb="16px">
{title}
</Heading>
<ClickableCard onClick={onClick} isSelected={false}>
{children}
</ClickableCard>
</Box>
</Flex>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/views/settings/BeaconDrawerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const BeaconDrawerCard = () => {
const { isOpen: isDynamicModalOpen } = useDynamicModal();
return (
<>
<SettingsCardWithDrawerIcon left="dApps" onClick={onOpen} />
<SettingsCardWithDrawerIcon left="dApps" onClick={onOpen} isSelected={isOpen} />
<Drawer
blockScrollOnMount={!isDynamicModalOpen}
isOpen={isOpen}
Expand Down
2 changes: 1 addition & 1 deletion src/views/settings/ErrorLogsDrawerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const ErrorLogsDrawerCard = () => {

return (
<>
<SettingsCardWithDrawerIcon left="ErrorLogs" onClick={onOpen} />
<SettingsCardWithDrawerIcon left="ErrorLogs" onClick={onOpen} isSelected={isOpen} />
<Drawer
blockScrollOnMount={!isDynamicModalOpen}
isOpen={isOpen}
Expand Down
21 changes: 13 additions & 8 deletions src/views/settings/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default function SettingsView() {
<Flex direction="column" height="100%">
<TopBar title="Settings" />
<Box overflowY="scroll">
<GeneralSection />
<Box marginTop="16px">
<GeneralSection />
</Box>
<AppUpdatesSection />
<BackupSection />
<AdvancedSection />
Expand All @@ -36,10 +38,8 @@ const GeneralSection = () => {
</Flex>
</SettingsCard>
*/}
<SettingsCard left="Network">
<Box>
<NetworkSelector />
</Box>
<SettingsCard left="Network" isSelected={false}>
<NetworkSelector />
</SettingsCard>
<ErrorLogsDrawerCard />
</SectionContainer>
Expand Down Expand Up @@ -129,8 +129,13 @@ const AdvancedSection = () => {
TODO: implement this
<SettingsCardWithDrawerIcon left="Reset Settings" onClick={() => {}} />
*/}
<SettingsCardWithDrawerIcon left="Off-board Wallet" onClick={onOpenOffboardingModal} />
<SettingsCardWithDrawerIcon
left="Off-board Wallet"
onClick={onOpenOffboardingModal}
isSelected={false}
/>
<SettingsCardWithDrawerIcon
isSelected={false}
left="Change Password"
onClick={() => openWith(<ChangePasswordForm />)}
/>
Expand All @@ -144,10 +149,10 @@ const SectionContainer: React.FC<{
children: React.ReactNode;
}> = ({ title, children }) => {
return (
<Box marginY={2}>
<Box marginTop="8px">
<Flex>
<Box w="550px">
<Heading size="lg" marginY={3}>
<Heading size="lg" marginBottom="16px">
{title}
</Heading>
{children}
Expand Down

0 comments on commit d42ee94

Please sign in to comment.