mirror of
https://github.com/goauthentik/authentik
synced 2026-04-27 09:57:31 +02:00
* website: Glossary fix minor issues wip Apply suggestion from @dominic-r Signed-off-by: Dominic R <dominic@sdko.org> anchor to param wip wip at least the lockfile changes now sure a-z first as tana asked idk why i switched in the first place wip wip lock lockfiles are hard wip please work no have? Revert "no have?" This reverts commit 743dbc1bc2900eedcc2c93af248e6afdec3688a3. * changed to sentence-case capitalization --------- Co-authored-by: Tana M Berry <tana@goauthentik.io>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import styles from "./styles.module.css";
|
||
|
||
import clsx from "clsx";
|
||
import React from "react";
|
||
|
||
/**
|
||
* Toggle between categorized and A–Z views in the glossary.
|
||
*/
|
||
export interface ViewToggleProps {
|
||
isSimplifiedView: boolean;
|
||
onChange: (simplified: boolean) => void;
|
||
}
|
||
|
||
export const ViewToggle: React.FC<ViewToggleProps> = ({ isSimplifiedView, onChange }) => {
|
||
return (
|
||
<div className={styles.viewToggleContainer}>
|
||
<p className={styles.viewTogglePrompt}>Views:</p>
|
||
<button
|
||
className={clsx(styles.viewToggle, isSimplifiedView && styles.viewToggleActive)}
|
||
onClick={() => onChange(true)}
|
||
aria-pressed={isSimplifiedView}
|
||
>
|
||
A-Z
|
||
</button>
|
||
<button
|
||
className={clsx(styles.viewToggle, !isSimplifiedView && styles.viewToggleActive)}
|
||
onClick={() => onChange(false)}
|
||
aria-pressed={!isSimplifiedView}
|
||
>
|
||
Tags
|
||
</button>
|
||
</div>
|
||
);
|
||
};
|
||
|
||
export default ViewToggle;
|