-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kseniyakuzina
committed
Sep 26, 2024
1 parent
ac8d206
commit 81fdde7
Showing
5 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/content/components/navigation/Footer/FooterComponent.scss
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,16 @@ | ||
@use '../../../../variables'; | ||
|
||
$block: '.#{variables.$ns}navigation-footer'; | ||
|
||
#{$block} { | ||
display: flex; | ||
flex-direction: column; | ||
position: relative; | ||
box-sizing: border-box; | ||
height: 100%; | ||
width: 100%; | ||
|
||
&__body { | ||
flex: 1; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/content/components/navigation/Footer/FooterComponent.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,31 @@ | ||
import {Footer, FooterProps, MobileFooter} from '@gravity-ui/navigation'; | ||
import React from 'react'; | ||
|
||
import {block} from '../../../../utils'; | ||
|
||
import './FooterComponent.scss'; | ||
import {logo, menuItems} from './constants'; | ||
|
||
const b = block('navigation-footer'); | ||
|
||
type FooterComponentProps = Pick<FooterProps, 'withDivider' | 'view' | 'copyright'> & { | ||
mobile?: boolean; | ||
}; | ||
|
||
export function FooterComponent({withDivider, view, copyright, mobile}: FooterComponentProps) { | ||
const Component = mobile ? MobileFooter : Footer; | ||
|
||
return ( | ||
<div className={b()}> | ||
<div className={b('body')} /> | ||
<Component | ||
className={b('footer')} | ||
menuItems={menuItems} | ||
copyright={copyright} | ||
logo={logo} | ||
withDivider={withDivider} | ||
view={view} | ||
/> | ||
</div> | ||
); | ||
} |
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,27 @@ | ||
import Aperture from '@gravity-ui/icons/svgs/aperture.svg'; | ||
import {FooterMenuItem} from '@gravity-ui/navigation'; | ||
|
||
export const menuItems: FooterMenuItem[] = [ | ||
{ | ||
text: 'About Service', | ||
href: 'https://gravity-ui.com/', | ||
target: 'blank', | ||
}, | ||
{ | ||
text: 'Documentation', | ||
href: 'https://gravity-ui.com/', | ||
target: 'blank', | ||
}, | ||
{ | ||
text: 'Confidential', | ||
href: 'https://gravity-ui.com/', | ||
target: 'blank', | ||
}, | ||
]; | ||
|
||
export const logo = { | ||
icon: Aperture, | ||
iconSize: 24, | ||
text: 'Gravity UI', | ||
'aria-label': 'Gravity UI', | ||
}; |
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 dynamic from 'next/dynamic'; | ||
|
||
import {Repos} from '../../../../types/common'; | ||
import {getGithubUrl, getReadmeUrl, mappingOptions} from '../../utils'; | ||
|
||
const getterOptions = {repoName: Repos.Navigation, componentName: 'Footer'}; | ||
|
||
export const footerConfig = { | ||
id: 'footer', | ||
title: 'Footer', | ||
githubUrl: getGithubUrl(getterOptions), | ||
content: { | ||
readmeUrl: getReadmeUrl(getterOptions), | ||
}, | ||
sandbox: { | ||
expandedContainer: true, | ||
component: dynamic(() => import('./FooterComponent').then((mod) => mod.FooterComponent)), | ||
props: { | ||
mobile: { | ||
type: 'switch', | ||
defaultValue: false, | ||
}, | ||
withDivider: { | ||
type: 'switch', | ||
defaultValue: true, | ||
}, | ||
view: { | ||
type: 'select', | ||
defaultValue: 'normal', | ||
values: mappingOptions(['normal', 'clear']), | ||
}, | ||
copyright: { | ||
type: 'text', | ||
defaultValue: `@ ${new Date().getFullYear()} "Gravity UI"`, | ||
}, | ||
}, | ||
}, | ||
}; |
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