Skip to content

Commit

Permalink
feat: improved the footer appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
kurone-kito committed Jun 22, 2021
1 parent 1c2c7c6 commit 8cb128c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ const Template: Story<Props> = ({ author, children }) => (
);

export const Default = Template.bind({});
Default.args = { author: 'Author', children: 'Children' };
Default.args = { author: 'Author', children: ['Children'] };
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ReactNode, VFC } from 'react';
import { Children, ReactNode, ReactNodeArray, VFC } from 'react';
import Logo from '../atoms/Logo';
import FooterNavigation from './FooterNavigation';

Expand All @@ -7,7 +7,7 @@ export interface Props {
/** Specifies the author name. */
readonly author?: ReactNode;
/** The children items. */
readonly children?: ReactNode;
readonly children?: ReactNodeArray;
}

/** The footer component */
Expand All @@ -23,7 +23,14 @@ const Component: VFC<Props> = ({ author, children }) => (
<div className="flex flex-grow items-center justify-center">
<FooterNavigation author={author} />
</div>
<div className="flex-shrink p-4">{children}</div>
<div className="flex flex-col flex-shrink p-4 lg:flex-row">
{Children.toArray(children).map((child, index) => (
// eslint-disable-next-line react/no-array-index-key
<div className="flex-shrink p-4" key={index}>
{child}
</div>
))}
</div>
</nav>
</footer>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ const Component: VFC<Props> = ({ author }) => (
<List
className="divide-x-2 divide-gray-500 divide-opacity-50 flex flex-row justify-center p-4"
itemType={({ className, ...props }) => (
// eslint-disable-next-line react/jsx-props-no-spreading
<li className={classNames('px-3', className)} {...props} />
<li
className={classNames('place-self-center px-3', className)}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
/>
)}
>
<>&copy; {author}</>
Expand Down

0 comments on commit 8cb128c

Please sign in to comment.