From ab3ec40a1ea8a21eb7a0468f841ad617e0b0155b Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Mon, 2 Aug 2021 14:01:56 +0200 Subject: feature: citation options --- components/tweaks.tsx | 533 ++++++++++++++------------------------------------ 1 file changed, 145 insertions(+), 388 deletions(-) (limited to 'components/tweaks.tsx') diff --git a/components/tweaks.tsx b/components/tweaks.tsx index 0568c7d..3c9ee00 100644 --- a/components/tweaks.tsx +++ b/components/tweaks.tsx @@ -96,10 +96,6 @@ export const Tweaks = (props: TweakProps) => { 'gray.500', 'gray.600', 'white', - 'black', - ] - const grays = [ - 'black', 'gray.100', 'gray.200', 'gray.300', @@ -109,7 +105,7 @@ export const Tweaks = (props: TweakProps) => { 'gray.700', 'gray.800', 'gray.900', - 'white', + 'black', ] return ( <> @@ -540,7 +536,7 @@ export const Tweaks = (props: TweakProps) => { ))} - {grays.map((color) => ( + {colorList.map((color) => ( @@ -606,211 +602,38 @@ export const Tweaks = (props: TweakProps) => { - - Link Highlight - - } - > - { - - } - - - {' '} - - - setVisuals({ ...visuals, linkHighlight: '' }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - {colorList.map((color) => ( - - setVisuals({ ...visuals, linkHighlight: color }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - ))} - - - - - - Node Highlight - - } - > - { - - } - - - {' '} - - - setVisuals({ ...visuals, nodeHighlight: '' }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - {colorList.map((color) => ( - - setVisuals({ ...visuals, nodeHighlight: color }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - ))} - - - - - - Background - - } - > - { - - } - - - {' '} - - {grays.map((color) => ( - - setVisuals({ ...visuals, backgroundColor: color }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - ))} - - - - - - Emacs Node - - } - > - { - - } - - - {' '} - - - setVisuals({ ...visuals, emacsNodeColor: '' }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - {colorList.map((color) => ( - - setVisuals({ ...visuals, emacsNodeColor: color }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - ))} - - - - + + + + @@ -862,6 +685,41 @@ export const Tweaks = (props: TweakProps) => { onChange={(value) => setVisuals({ ...visuals, linkOpacity: value })} /> )} + setVisuals({ ...visuals, citeDashes: !visuals.citeDashes })} + > + + setVisuals({ ...visuals, citeDashLength: value * 10 }) + } + /> + setVisuals({ ...visuals, citeGapLength: value * 5 })} + /> + + + Labels @@ -906,108 +764,22 @@ export const Tweaks = (props: TweakProps) => { paddingLeft={2} color="gray.800" > - - Text - - } - color="black" - colorScheme="" - > - { - - } - - - {' '} - - {grays.map((color) => ( - - setVisuals({ - ...visuals, - labelTextColor: color, - }) - } - > - - - ))} - - - - - - Background - - } - color="black" - colorScheme="" - > - { - - } - - - {' '} - - - setVisuals({ - ...visuals, - labelBackgroundColor: '', - }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - None - - {grays.map((color) => ( - - setVisuals({ - ...visuals, - labelBackgroundColor: color, - }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - ))} - - - - + + { step={0.01} onChange={(value) => setVisuals({ ...visuals, arrowsPos: value })} /> - - Arrow Color - - } - > - { - - } - - - {' '} - - setVisuals({ ...visuals, arrowsColor: '' })} - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - {colorList.map((color) => ( - - setVisuals({ - ...visuals, - arrowsColor: color, - }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - ))} - {grays.map((color) => ( - - setVisuals({ - ...visuals, - arrowsColor: color, - }) - } - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - ))} - - - - + { ) } + +export interface ColorMenuProps { + label: string + colorList: string[] + value: string + visuals: typeof initialVisuals + visValue: string + setVisuals?: any +} + +export const ColorMenu = (props: ColorMenuProps) => { + const { label, colorList, value, visuals, visValue, setVisuals } = props + return ( + + {label} + + }> + {} + + + {' '} + + setVisuals({ ...visuals, [value]: '' })} + justifyContent="space-between" + alignItems="center" + display="flex" + > + + + {colorList.map((color: string) => ( + + setVisuals({ + ...visuals, + [value]: color, + }) + } + justifyContent="space-between" + alignItems="center" + display="flex" + > + + + ))} + + + + + ) +} -- cgit v1.2.3