-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
a6c36f7
commit 04fe3c5
Showing
5 changed files
with
120 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.wrap { | ||
display: flex; | ||
justify-content: space-between; | ||
} |
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 React from "react"; | ||
import Copyright from "@theme-original/Footer/Copyright"; | ||
import type CopyrightType from "@theme/Footer/Copyright"; | ||
import type { WrapperProps } from "@docusaurus/types"; | ||
import styles from "./index.module.css"; | ||
|
||
type Props = WrapperProps<typeof CopyrightType>; | ||
|
||
export default function CopyrightWrapper(props: Props): JSX.Element { | ||
return ( | ||
<> | ||
<div className={styles.wrap}> | ||
<Copyright {...props} /> | ||
social | ||
</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,49 @@ | ||
import React from "react"; | ||
import LinkItem from "@theme/Footer/LinkItem"; | ||
import type { Props } from "@theme/Footer/Links/MultiColumn"; | ||
|
||
type ColumnType = Props["columns"][number]; | ||
type ColumnItemType = ColumnType["items"][number]; | ||
|
||
function ColumnLinkItem({ item }: { item: ColumnItemType }) { | ||
return item.html ? ( | ||
<li | ||
className="footer__item" | ||
// Developer provided the HTML, so assume it's safe. | ||
// eslint-disable-next-line react/no-danger | ||
dangerouslySetInnerHTML={{ __html: item.html }} | ||
/> | ||
) : ( | ||
<li key={item.href ?? item.to} className="footer__item"> | ||
<LinkItem item={item} /> | ||
</li> | ||
); | ||
} | ||
|
||
function Column({ column }: { column: ColumnType }) { | ||
return ( | ||
<div className="col footer__col"> | ||
<div className="footer__title">{column.title}</div> | ||
<ul className="footer__items clean-list"> | ||
{column.items.map((item, i) => ( | ||
<ColumnLinkItem key={i} item={item} /> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
} | ||
|
||
export default function FooterLinksMultiColumn({ | ||
columns, | ||
}: Props): JSX.Element { | ||
return ( | ||
<div className="row footer__links"> | ||
<div className="col"> | ||
<img src="/img/Logo.aelf.svg" /> | ||
</div> | ||
{columns.map((column, i) => ( | ||
<Column key={i} column={column} /> | ||
))} | ||
</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,35 @@ | ||
import React from 'react'; | ||
import LinkItem from '@theme/Footer/LinkItem'; | ||
import type {Props} from '@theme/Footer/Links/Simple'; | ||
|
||
function Separator() { | ||
return <span className="footer__link-separator">·</span>; | ||
} | ||
|
||
function SimpleLinkItem({item}: {item: Props['links'][number]}) { | ||
return item.html ? ( | ||
<span | ||
className="footer__link-item" | ||
// Developer provided the HTML, so assume it's safe. | ||
// eslint-disable-next-line react/no-danger | ||
dangerouslySetInnerHTML={{__html: item.html}} | ||
/> | ||
) : ( | ||
<LinkItem item={item} /> | ||
); | ||
} | ||
|
||
export default function FooterLinksSimple({links}: Props): JSX.Element { | ||
return ( | ||
<div className="footer__links text--center"> | ||
<div className="footer__links"> | ||
{links.map((item, i) => ( | ||
<React.Fragment key={i}> | ||
<SimpleLinkItem item={item} /> | ||
{links.length !== i + 1 && <Separator />} | ||
</React.Fragment> | ||
))} | ||
</div> | ||
</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,14 @@ | ||
import React from 'react'; | ||
|
||
import {isMultiColumnFooterLinks} from '@docusaurus/theme-common'; | ||
import FooterLinksMultiColumn from '@theme/Footer/Links/MultiColumn'; | ||
import FooterLinksSimple from '@theme/Footer/Links/Simple'; | ||
import type {Props} from '@theme/Footer/Links'; | ||
|
||
export default function FooterLinks({links}: Props): JSX.Element { | ||
return isMultiColumnFooterLinks(links) ? ( | ||
<FooterLinksMultiColumn columns={links} /> | ||
) : ( | ||
<FooterLinksSimple links={links} /> | ||
); | ||
} |