-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS]chore: refactor footer and menu (#810)
- Loading branch information
1 parent
a3b6a84
commit f83cfc7
Showing
19 changed files
with
328 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 29 additions & 11 deletions
40
packages/apps/docs/src/components/Layout/components/Footer/FooterLink.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,29 @@ | ||
import { styled, StyledComponent } from '@kadena/react-components'; | ||
|
||
export const FooterLink: StyledComponent<'a'> = styled('a', { | ||
textDecoration: 'none', | ||
color: '$neutral4', | ||
padding: '0 $3', | ||
'&:hover': { | ||
textDecoration: 'underline', | ||
color: '$neutral5', | ||
}, | ||
}); | ||
import { Text } from '@kadena/react-ui'; | ||
|
||
import { linkClass } from './styles.css'; | ||
|
||
import Link from 'next/link'; | ||
import React, { FC, ReactNode } from 'react'; | ||
|
||
interface IProps { | ||
children?: ReactNode; | ||
href: string; | ||
} | ||
|
||
export const FooterLink: FC<IProps> = ({ children, href }) => { | ||
const isInnerLink = href.includes('http'); | ||
|
||
return ( | ||
<Text size="md" bold={false}> | ||
{isInnerLink ? ( | ||
<a href={href} className={linkClass}> | ||
{children} | ||
</a> | ||
) : ( | ||
<Link href={href} className={linkClass}> | ||
{children} | ||
</Link> | ||
)} | ||
</Text> | ||
); | ||
}; |
10 changes: 3 additions & 7 deletions
10
packages/apps/docs/src/components/Layout/components/Footer/FooterText.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
import { styled } from '@kadena/react-components'; | ||
import { Text } from '@kadena/react-ui'; | ||
|
||
import { textClass } from './styles.css'; | ||
|
||
import React, { FC, ReactNode } from 'react'; | ||
|
||
interface IProps { | ||
children?: ReactNode; | ||
} | ||
|
||
const StyledText = styled('span', { | ||
color: '$neutral4', | ||
padding: '0 $3', | ||
}); | ||
|
||
export const FooterText: FC<IProps> = ({ children }) => { | ||
return ( | ||
<Text size="md" bold={false}> | ||
<StyledText>{children}</StyledText> | ||
<span className={textClass}>{children}</span> | ||
</Text> | ||
); | ||
}; |
64 changes: 64 additions & 0 deletions
64
packages/apps/docs/src/components/Layout/components/Footer/styles.css.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { darkThemeClass, sprinkles, vars } from '@kadena/react-ui/theme'; | ||
|
||
import { $$navMenu, $$pageWidth } from '../../global.css'; | ||
|
||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const footerWrapperClass = style([ | ||
sprinkles({ | ||
position: 'relative', | ||
background: '$neutral2', | ||
marginTop: '$40', | ||
}), | ||
{ | ||
zIndex: $$navMenu, | ||
gridArea: 'footer', | ||
selectors: { | ||
[`${darkThemeClass} &`]: { | ||
background: vars.colors.$neutral3, | ||
}, | ||
}, | ||
}, | ||
]); | ||
|
||
export const footerClass = style([ | ||
sprinkles({ | ||
position: 'relative', | ||
display: 'flex', | ||
alignItems: 'center', | ||
paddingY: '$3', | ||
paddingX: '$4', | ||
|
||
flexDirection: { | ||
xs: 'column', | ||
md: 'row', | ||
}, | ||
}), | ||
{ | ||
margin: '0 auto', | ||
maxWidth: $$pageWidth, | ||
}, | ||
]); | ||
|
||
export const textClass = style([ | ||
sprinkles({ | ||
color: '$neutral4', | ||
paddingX: '$3', | ||
}), | ||
]); | ||
|
||
export const linkClass = style([ | ||
sprinkles({ | ||
textDecoration: 'none', | ||
color: '$neutral4', | ||
paddingX: '$3', | ||
}), | ||
{ | ||
selectors: { | ||
'&:hover': { | ||
textDecoration: 'underline', | ||
color: vars.colors.$neutral5, | ||
}, | ||
}, | ||
}, | ||
]); |
37 changes: 0 additions & 37 deletions
37
packages/apps/docs/src/components/Layout/components/Footer/styles.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/apps/docs/src/components/Layout/components/Menu/Menu.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { | ||
menuClass, | ||
menuInLayoutVariants, | ||
menuLayoutVariants, | ||
menuOpenVariants, | ||
} from './menu.css'; | ||
|
||
import classNames from 'classnames'; | ||
import React, { FC, ReactNode } from 'react'; | ||
|
||
interface IProps { | ||
children?: ReactNode; | ||
dataCy?: string; | ||
isOpen?: boolean; | ||
inLayout?: boolean; | ||
layout: 'landing' | 'normal'; | ||
} | ||
|
||
export const Menu: FC<IProps> = ({ | ||
children, | ||
dataCy, | ||
isOpen = false, | ||
inLayout = false, | ||
layout = 'normal', | ||
}) => { | ||
const classes = classNames( | ||
menuClass, | ||
menuOpenVariants[isOpen ? 'isOpen' : 'isClosed'], | ||
menuInLayoutVariants[inLayout ? 'true' : 'false'], | ||
menuLayoutVariants[layout], | ||
); | ||
|
||
return ( | ||
<div data-cy={dataCy} className={classes}> | ||
{children} | ||
</div> | ||
); | ||
}; |
18 changes: 18 additions & 0 deletions
18
packages/apps/docs/src/components/Layout/components/Menu/MenuBack.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { menuBackClass, menuBackOpenVariants } from './menu.css'; | ||
|
||
import classNames from 'classnames'; | ||
import React, { FC } from 'react'; | ||
|
||
interface IProps { | ||
isOpen?: boolean; | ||
onClick: () => void; | ||
} | ||
|
||
export const MenuBack: FC<IProps> = ({ isOpen = false, onClick }) => { | ||
const classes = classNames( | ||
menuBackClass, | ||
menuBackOpenVariants[isOpen ? 'isOpen' : 'isClosed'], | ||
); | ||
|
||
return <button type="button" className={classes} onClick={onClick} />; | ||
}; |
2 changes: 2 additions & 0 deletions
2
packages/apps/docs/src/components/Layout/components/Menu/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { Menu } from './Menu'; | ||
export { MenuBack } from './MenuBack'; |
Oops, something went wrong.
f83cfc7
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.
Successfully deployed to the following URLs:
docs-storybook – ./packages/apps/docs
docs-storybook-git-main-kadena-js.vercel.app
kadena-js-docs.vercel.app
docs-storybook-kadena-js.vercel.app
f83cfc7
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.
Successfully deployed to the following URLs:
alpha-docs – ./packages/apps/docs
alpha-docs-kadena-js.vercel.app
alpha-docs-git-main-kadena-js.vercel.app
docs-silk-two.vercel.app
alpha-docs.kadena.io