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

[PRD] | [Issue #2545] add more socials #2584

Merged
merged 8 commits into from
Dec 3, 2024
52 changes: 24 additions & 28 deletions src/components/ui/links/ExternalLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,35 +105,31 @@ export default function ExternalLink({
};

return (
<Flex>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to wrap in a Flex

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure there was an intent for this one - could you please make sure it didn't wrecked in all the places where this component being used?

<Link
color={linkColor[styleVariant]}
padding="0.25rem 0.75rem"
<Link
padding="0.25rem 0.75rem"
color={linkColor[styleVariant]}
gap="0.25rem"
borderColor="transparent"
borderWidth="1px"
borderRadius="625rem"
w="fit-content"
_hover={isTextLink ? textLinkStyles[styleVariant].hover : pillLinkStyles[styleVariant].hover}
_active={
isTextLink ? textLinkStyles[styleVariant].active : pillLinkStyles[styleVariant].active
}
target="_blank"
rel="noreferrer"
textDecoration="none"
ref={internalRef}
{...rest}
>
<Flex
gap="0.25rem"
borderRadius="625rem"
borderColor="transparent"
borderWidth="1px"
_hover={
isTextLink ? textLinkStyles[styleVariant].hover : pillLinkStyles[styleVariant].hover
}
_active={
isTextLink ? textLinkStyles[styleVariant].active : pillLinkStyles[styleVariant].active
}
target="_blank"
rel="noreferrer"
textDecoration="none"
ref={internalRef}
{...rest}
alignItems="center"
>
<Flex
gap="0.25rem"
mx="-0.75rem"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure why this was here? The hover state's padding was being squeezed by this.

alignItems="center"
>
{children}
{isTextLink && <ArrowUpRight />}
</Flex>
</Link>
</Flex>
{children}
{isTextLink && <ArrowUpRight />}
</Flex>
</Link>
);
}
79 changes: 72 additions & 7 deletions src/components/ui/page/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,59 @@
import { Flex } from '@chakra-ui/react';
import { Box, ComponentWithAs, Flex, Icon as ChakraIcon, IconProps } from '@chakra-ui/react';
import { DiscordLogo, Icon, TelegramLogo, XLogo } from '@phosphor-icons/react';
import { useTranslation } from 'react-i18next';
import { URL_DECENT } from '../../../constants/url';
import { Link } from 'react-router-dom';
import { WarpcastIcon } from '../../../assets/theme/custom/icons/WarpcastIcon';
import {
URL_DECENT,
URL_DISCORD,
URL_TELEGRAM,
URL_TWITTER,
URL_WARPCAST,
} from '../../../constants/url';
import ExternalLink from '../links/ExternalLink';

function NavigationIconLink(props: {
DisplayIcon: Icon | ComponentWithAs<'svg', IconProps>;
to: string;
ariaLabel: string;
}) {
const { t } = useTranslation('navigation');
const { DisplayIcon, to, ariaLabel } = props;
return (
<Link
aria-label={t(ariaLabel)}
to={to}
>
<Box p="0.25rem">
<Flex
py="6px"
px="6px"
borderRadius={{ md: 4 }}
transition="all ease-out 300ms"
_hover={{ bgColor: 'neutral-3' }}
>
<ChakraIcon
as={DisplayIcon}
boxSize="1rem"
/>
</Flex>
</Box>
</Link>
);
}

export function Footer() {
const { t } = useTranslation('home');
const { t } = useTranslation(['navigation', 'home']);
return (
<Flex
w="100%"
flexWrap="wrap"
justifyContent={{ base: 'flex-start', md: 'center' }}
alignItems="center"
gap={{ base: 4, md: 8 }}
gap={4}
>
<Flex gap={4}>
<ExternalLink href="/docs/fractal_audit.pdf">{t('audit')}</ExternalLink>
<Flex>
<ExternalLink href="/docs/fractal_audit.pdf">{t('audit', { ns: 'home' })}</ExternalLink>
<ExternalLink
href={`https://github.com/decentdao/decent-interface/releases/tag/v${import.meta.env.PACKAGE_VERSION}`}
>
Expand All @@ -27,8 +66,34 @@ export function Footer() {
styleVariant="grey"
fontSize="1.2rem"
>
{t('madeWithLove')}
{t('madeWithLove', { ns: 'home' })}
</ExternalLink>

<Flex
gap={4}
alignItems="center"
>
<NavigationIconLink
to={URL_TELEGRAM}
ariaLabel="navigationExternalTelegram"
DisplayIcon={TelegramLogo}
/>
<NavigationIconLink
to={URL_TWITTER}
ariaLabel="navigationExternalX"
DisplayIcon={XLogo}
/>
<NavigationIconLink
to={URL_WARPCAST}
ariaLabel="navigationExternalWarpcast"
DisplayIcon={WarpcastIcon}
/>
<NavigationIconLink
to={URL_DISCORD}
ariaLabel="navigationExternalDiscord"
DisplayIcon={DiscordLogo}
/>
</Flex>
</Flex>
);
}
11 changes: 1 addition & 10 deletions src/components/ui/page/Navigation/NavigationLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Box, Flex, Hide } from '@chakra-ui/react';
import { BookOpen, Coins, GitFork, House, Question, UsersThree } from '@phosphor-icons/react';
import { WarpcastIcon } from '../../../../assets/theme/custom/icons/WarpcastIcon';
import { DAO_ROUTES } from '../../../../constants/routes';
import { URL_CHAT, URL_DOCS, URL_FAQ } from '../../../../constants/url';
import { URL_DOCS, URL_FAQ } from '../../../../constants/url';
import { useNetworkConfig } from '../../../../providers/NetworkConfig/NetworkConfigProvider';
import { useDaoInfoStore } from '../../../../store/daoInfo/useDaoInfoStore';
import Divider from '../../utils/Divider';
Expand Down Expand Up @@ -31,14 +30,6 @@ function ExternalLinks({ closeDrawer }: { closeDrawer?: () => void }) {
scope="external"
closeDrawer={closeDrawer}
/>
<NavigationLink
href={URL_CHAT}
labelKey="chat"
testId="navigationExternal-chat"
NavigationIcon={WarpcastIcon}
scope="external"
closeDrawer={closeDrawer}
/>
<NavigationLink
href={URL_DOCS}
labelKey="documentation"
Expand Down
5 changes: 4 additions & 1 deletion src/constants/url.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export const URL_FAQ = 'https://docs.decentdao.org/app/learn-more/faq';
export const URL_CHAT = 'https://warpcast.com/~/channel/decentdao';
export const URL_WARPCAST = 'https://warpcast.com/~/channel/decentdao';
export const URL_DOCS = 'https://docs.decentdao.org/app';
export const URL_DOCS_GOV_TYPES = 'https://docs.decentdao.org/app/user-guide/types';
export const URL_DECENT = 'https://www.decentdao.org/';
export const URL_TWITTER = 'https://x.com/decentdao';
export const URL_TELEGRAM = 'https://t.me/+ZmKrTaL3pQcyOGRh';
export const URL_DISCORD = 'https://discord.gg/Zh2emKspVF';
6 changes: 5 additions & 1 deletion src/i18n/locales/en/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
"faq": "FAQ",
"chat": "Warpcast",
"documentation": "Documentation",
"ariaLabelFractalBrand": "Navigate Decent Home"
"ariaLabelFractalBrand": "Navigate Decent Home",
"navigationExternalTelegram": "Go to telegram",
"navigationExternalX": "Go to X",
"navigationExternalWarpcast": "Go to Warpcast",
"navigationExternalDiscordmade": "Go to Discord"
}
Loading