Added Socials to Footer

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2021-05-01 23:01:02 +02:00
parent fe6b552a69
commit f3597f3008
Signed by: Florian Bouillon
GPG Key ID: 50BD648F12C86AB6
3 changed files with 26 additions and 3 deletions

View File

@ -13,6 +13,9 @@
li li
display inline-block display inline-block
&.socials a
padding 0 8px
.animation .animation
animation grow 1s linear infinite animation grow 1s linear infinite
display inline-block display inline-block

View File

@ -1,5 +1,6 @@
import { Meta, Story } from '@storybook/react/types-6-0' import { Meta, Story } from '@storybook/react/types-6-0'
import React from 'react' import React from 'react'
import { Zap } from 'react-feather'
import Component from '.' import Component from '.'
export default { export default {
@ -10,6 +11,9 @@ export default {
export const Basic: Story<any> = (args: any) => <Component {...args} /> export const Basic: Story<any> = (args: any) => <Component {...args} />
let tmp = Basic.bind({}) let tmp = Basic.bind({})
tmp.args = {links: [{name: 'test1', path: '/'}, {name: 'test2', path: '/'}, {name: 'test3', path: '/'}]} tmp.args = {
links: [{name: 'test1', path: '/'}, {name: 'test2', path: '/'}, {name: 'test3', path: '/'}],
socials: [{icon: Zap, href: '/'}, {icon: '/16-16.svg', href: '/'}, {icon: Zap, href: '/'}]
}
export const Normal = tmp export const Normal = tmp

View File

@ -1,9 +1,10 @@
import React from 'react' import React, { FC } from 'react'
import { Heart } from 'react-feather' import { Heart } from 'react-feather'
import Link from '../Link' import Link from '../Link'
import { Icon } from 'react-feather'
import Text from '../Text' import Text from '../Text'
import css from './Footer.module.styl' import css from './Footer.module.styl'
import Image from 'next/image'
interface Props { interface Props {
text?: string text?: string
@ -12,6 +13,10 @@ interface Props {
path: string path: string
name: string name: string
}> }>
socials?: Array<{
href: string
icon: Icon | string
}>
} }
export default class Footer extends React.Component<Props> { export default class Footer extends React.Component<Props> {
@ -27,6 +32,17 @@ export default class Footer extends React.Component<Props> {
<li key={l.path}><Text>{index !== 0 && (<>&nbsp;- </>)}<Link href={l.path}>{l.name}</Link></Text></li> <li key={l.path}><Text>{index !== 0 && (<>&nbsp;- </>)}<Link href={l.path}>{l.name}</Link></Text></li>
))}</ul> ))}</ul>
)} )}
{this.props.socials && (
<ul className={css.socials}>{this.props.socials.map((l, index) => (
<li key={l.href}><Text><Link noStyle href={l.href}>
{typeof l.icon === 'string' ? (
<Image width={24} height={24} src={l.icon} />
) : (
<l.icon size={24} />
)}
</Link></Text></li>
))}</ul>
)}
</footer> </footer>
) )
} }