Skip to content

Commit

Permalink
fix: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasz97 committed Sep 18, 2024
1 parent 8a45ccc commit 63da85a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 35 deletions.
23 changes: 5 additions & 18 deletions src/components/form/Multiselect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@builder.io/qwik';
import { initFlowbite } from 'flowbite';
import { t } from '../../locale/labels';
import { getIcon } from '../icons';

interface multiSelectInterface {
id: string;
Expand Down Expand Up @@ -61,7 +62,7 @@ export const Multiselect = component$<multiSelectInterface>(
if (value.value.length === options.value.length) {
value.value = [];
} else {
value.value = [...options.value];
value.value = options.value;
}
});

Expand Down Expand Up @@ -119,21 +120,7 @@ export const Multiselect = component$<multiSelectInterface>(
<span class={['truncate', value.value.length === 0 && 'text-darkgray-500']}>
{value.value.join(', ') || placeholder}
</span>
<svg
class='text-darkgray-700 m-[5px] h-2.5 w-2.5'
aria-hidden='true'
xmlns='http://www.w3.org/2000/svg'
fill='none'
viewBox='0 0 10 6'
>
<path
stroke='currentColor'
stroke-linecap='round'
stroke-linejoin='round'
stroke-width='2'
d='m1 1 4 4 4-4'
/>
</svg>
{getIcon('Downarrow')}
</button>

{invalid && <p class='mt-1 text-xs text-red-500'>{t('REQUIRED_FIELD_LABEL')}</p>}
Expand All @@ -150,7 +137,7 @@ export const Multiselect = component$<multiSelectInterface>(
id='checkbox-item-1'
type='checkbox'
value=''
class='h-4 w-4 rounded border-gray-300 bg-gray-100 text-blue-600 focus:ring-2 focus:ring-blue-500 dark:border-gray-500 dark:bg-gray-600 dark:ring-offset-gray-700 dark:focus:ring-blue-600 dark:focus:ring-offset-gray-700'
class='h-4 w-4 rounded border-gray-300 bg-gray-100 text-clara-red focus:ring-2 focus:ring-clara-red'
/>
<label
for='checkbox-item-1'
Expand All @@ -170,7 +157,7 @@ export const Multiselect = component$<multiSelectInterface>(
id={'checkbox-item-' + index}
type='checkbox'
value=''
class='h-4 w-4 rounded border-gray-300 bg-gray-100 text-blue-600 focus:ring-2 focus:ring-blue-500 dark:border-gray-500 dark:bg-gray-600 dark:ring-offset-gray-700 dark:focus:ring-blue-600 dark:focus:ring-offset-gray-700'
class='h-4 w-4 rounded border-gray-300 bg-gray-100 text-clara-red focus:ring-2 focus:ring-clara-red'
/>
<label
for={'checkbox-item-' + index}
Expand Down
17 changes: 2 additions & 15 deletions src/components/form/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@builder.io/qwik';
import { initFlowbite } from 'flowbite';
import { t } from '../../locale/labels';
import { getIcon } from '../icons';

interface selectInterface {
id: string;
Expand Down Expand Up @@ -88,21 +89,7 @@ export const Select = component$<selectInterface>(
<span class={['truncate', !value.value && 'text-darkgray-500']}>
{value.value || placeholder}
</span>
<svg
class='text-darkgray-700 m-[5px] h-2.5 w-2.5'
aria-hidden='true'
xmlns='http://www.w3.org/2000/svg'
fill='none'
viewBox='0 0 10 6'
>
<path
stroke='currentColor'
stroke-linecap='round'
stroke-linejoin='round'
stroke-width='2'
d='m1 1 4 4 4-4'
/>
</svg>
{getIcon('Downarrow')}
</button>

{invalid && <p class='mt-1 text-xs text-red-500'>{t('REQUIRED_FIELD_LABEL')}</p>}
Expand Down
21 changes: 21 additions & 0 deletions src/components/icons/DownArrow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { component$ } from '@builder.io/qwik';

export const DownArrow = component$(() => {
return (
<svg
class='text-darkgray-700 m-[5px] h-2.5 w-2.5'
aria-hidden='true'
xmlns='http://www.w3.org/2000/svg'
fill='none'
viewBox='0 0 10 6'
>
<path
stroke='currentColor'
stroke-linecap='round'
stroke-linejoin='round'
stroke-width='2'
d='m1 1 4 4 4-4'
/>
</svg>
);
});
3 changes: 3 additions & 0 deletions src/components/icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Claranet } from './Claranet';
import { Clear } from './Clear';
import { Close } from './Close';
import { Design } from './Design';
import { DownArrow } from './DownArrow';
import { Downalod } from './Download';
import { Edit } from './Edit';
import { EditWhite } from './EditWhite';
Expand Down Expand Up @@ -125,6 +126,8 @@ export const getIcon = (skill: string) => {
return <Info />;
case 'Download':
return <Downalod />;
case 'Downarrow':
return <DownArrow />;
default:
return <AWS />;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/report/GropuByList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const GroupByList = component$<GroupByListProps>(({ data, from, to }) =>
<div class='flex flex-none flex-row items-center gap-2'>
<Button variant={'link'} onClick$={handlerDownloadCSV}>
<span class='inline-flex items-start gap-1'>
{getIcon('Downlaod')} {t('REPORT_DOWNLOAD_CSV_LABEL')}
{getIcon('Download')} {t('REPORT_DOWNLOAD_CSV_LABEL')}
</span>
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/report/ReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const ReportHeader = component$<ReportHeaderProps>(

<Button variant={'link'} onClick$={downloadCSV}>
<span class='inline-flex items-start gap-1'>
{getIcon('Downlaod')} {t('REPORT_DOWNLOAD_CSV_LABEL')}
{getIcon('Download')} {t('REPORT_DOWNLOAD_CSV_LABEL')}
</span>
</Button>
</div>
Expand Down

0 comments on commit 63da85a

Please sign in to comment.