mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
* package updates * bump Next.js * update for Next.js v13 new `Link` behavior * see https://nextjs.org/docs/upgrading#link-component * test tweaks, simplify getNetworkDisplayName() * modify codeclimate excludes * test tweaks and cleanup * more cleanup * switch to Node.js v18 * back to Node.js v16 * temporarily run CI against Node.js v16 & v18 * update codeowners * fixtures fixes for asset price * switch to Node.js v18 * package updates * remark updates, typescript and test fixes * fix * test run fixes * yet another lockfileVersion update * package updates * test run fixes
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import React, { ReactElement } from 'react'
|
|
import styles from './PrivacyLanguages.module.css'
|
|
import { usePrivacyMetadata } from '@hooks/usePrivacyMetadata'
|
|
import { useUserPreferences } from '@context/UserPreferences'
|
|
import Link from 'next/link'
|
|
|
|
export default function PrivacyLanguages({
|
|
label
|
|
}: {
|
|
label?: string
|
|
}): ReactElement {
|
|
const { policies } = usePrivacyMetadata()
|
|
const { setPrivacyPolicySlug } = useUserPreferences()
|
|
|
|
return (
|
|
<div className={styles.langSelect}>
|
|
<span className={styles.langLabel}>{label || 'Language'}</span>
|
|
<div className={styles.langOptions}>
|
|
{policies.map((policy, i) => {
|
|
const slug = `/privacy/${policy.policy}`
|
|
return (
|
|
<React.Fragment key={policy.policy}>
|
|
{i > 0 && ' — '}
|
|
<Link
|
|
href={slug}
|
|
onClick={() => {
|
|
setPrivacyPolicySlug(slug)
|
|
}}
|
|
>
|
|
{policy.language}
|
|
</Link>
|
|
</React.Fragment>
|
|
)
|
|
})}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|