Skip to content

Commit 7088798

Browse files
committed
subtle gradient border on export-button, aligmnent, and hover over items
1 parent 0b9724f commit 7088798

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

src/components/synthetic-data/export-button.tsx

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,61 @@ export const ExportButton = ({
1818
reactToPrintFn,
1919
data,
2020
handleExport,
21+
buttonAlign,
2122
}: {
23+
buttonAlign: 'left' | 'right' | 'center';
2224
clusterInfo: SyntheticDataInfo | undefined;
2325
reactToPrintFn: UseReactToPrintFn;
2426
data: SyntheticData;
2527
handleExport: (syntheticData: object[]) => void;
2628
}) => {
2729
const { t } = useTranslation();
30+
const buttonAlignClass =
31+
buttonAlign === 'left'
32+
? 'mr-auto'
33+
: buttonAlign === 'right'
34+
? 'ml-auto'
35+
: 'mx-auto';
2836
return (
2937
<div className="flex flex-row gap-2 hideonprint">
3038
<DropdownMenu>
3139
<DropdownMenuTrigger asChild>
3240
<Button
3341
variant="default"
3442
size="sm"
35-
className="mx-auto py-6 px-4 text-sm bg-aaRegularLight hover:bg-aaRegularLight text-black hover:text-black transform transition-colors duration-200 group"
43+
className={`${buttonAlignClass} py-6 px-4 text-sm
44+
bg-aaRegularLight hover:bg-aaRegularLight
45+
text-black hover:text-black
46+
transform transition-colors duration-200 group
47+
relative
48+
before:absolute before:inset-0
49+
before:p-[3px] before:rounded-md
50+
before:bg-gradient-to-br before:from-[#60a5fa] before:to-[#c5d8eb]
51+
before:-z-10
52+
after:absolute after:inset-[2px]
53+
after:rounded-[4px]
54+
after:bg-aaRegularLight
55+
after:-z-10`}
3656
>
3757
{t('downloadButton')}
3858
<ChevronDown className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180" />
3959
</Button>
4060
</DropdownMenuTrigger>
4161
<DropdownMenuContent
4262
align="end"
43-
className="bg-white p-4 rounded-md flex flex-col gap-2 shadow-md"
63+
className="bg-white rounded-md flex flex-col gap-0 shadow-md"
4464
>
4565
<DropdownMenuItem
4666
onClick={() => reactToPrintFn()}
47-
className="flex flex-row items-center cursor-pointer"
67+
className="px-4 py-2 flex flex-row items-center cursor-pointer hover:bg-slate-100 rounded-md transition-colors duration-200"
4868
>
4969
<Share className="size-3.5 mr-2" />
5070
{t('syntheticData.exportToPDF')}
5171
</DropdownMenuItem>
5272
{clusterInfo && (
5373
<>
5474
<DropdownMenuItem
55-
className="flex flex-row items-center cursor-pointer"
75+
className="px-4 py-2 flex flex-row items-center cursor-pointer hover:bg-slate-100 rounded-md transition-colors duration-200"
5676
onClick={() => {
5777
downloadFile(
5878
JSON.stringify(
@@ -72,7 +92,7 @@ export const ExportButton = ({
7292
{t('syntheticData.exportToJSON')}
7393
</DropdownMenuItem>
7494
<DropdownMenuItem
75-
className="flex flex-row items-center cursor-pointer"
95+
className="px-4 py-2 flex flex-row items-center cursor-pointer hover:bg-slate-100 rounded-md transition-colors duration-200"
7696
onClick={() => {
7797
handleExport(
7898
clusterInfo.syntheticData as object[]

src/routes/SyntheticData.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export default function SyntheticDataGeneration() {
156156
>
157157
{initialised && data.data.length > 0 && result.length > 0 && (
158158
<ExportButton
159+
buttonAlign="right"
159160
clusterInfo={clusterInfo}
160161
data={data}
161162
handleExport={handleExport}
@@ -177,6 +178,7 @@ export default function SyntheticDataGeneration() {
177178

178179
{initialised && data.data.length > 0 && result.length > 0 && (
179180
<ExportButton
181+
buttonAlign="center"
180182
clusterInfo={clusterInfo}
181183
data={data}
182184
handleExport={handleExport}

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default {
2222
},
2323
colors: {
2424
aaLight: '#deecf7',
25-
aaRegularLight: '#c5d8eb',
25+
aaRegularLight: '#deecf7',
2626
aaRegular: '#005aa7',
2727
aaDark: '#0a3f70',
2828
},

0 commit comments

Comments
 (0)