Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: match select component with figma #696

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 5 additions & 19 deletions dashboard/components/select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useState } from 'react';
import classNames from 'classnames';
import ChevronDownIcon from '../icons/ChevronDownIcon';

export type SelectProps = {
label: string;
Expand Down Expand Up @@ -29,27 +30,12 @@ function Select({
className="pointer-events-none absolute right-4
bottom-[1.15rem] text-black-900 transition-all"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="none"
viewBox="0 0 24 24"
>
<path
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeMiterlimit="10"
strokeWidth="1.5"
d="M19.92 8.95l-6.52 6.52c-.77.77-2.03.77-2.8 0L4.08 8.95"
></path>
</svg>
<ChevronDownIcon width={24} height={24} />
</div>
<button
onClick={toggle}
className={classNames(
'h-[60px] w-full overflow-hidden rounded text-left outline outline-black-200/50 hover:outline-black-200 focus:outline-2 focus:outline-primary',
'h-[60px] w-full overflow-hidden rounded text-left outline outline-black-200/50 hover:outline-black-200 focus:outline-primary',
{ 'outline-2 outline-primary': isOpen }
)}
>
Expand All @@ -68,8 +54,8 @@ function Select({
onClick={toggle}
className="fixed inset-0 z-20 hidden animate-fade-in bg-transparent opacity-0 sm:block"
></div>
<div className="absolute top-[4.15rem] z-[21] w-full overflow-hidden rounded-lg border border-black-200 bg-white p-2 shadow-lg">
<div className="flex w-full flex-col gap-2">
<div className="absolute top-[66px] z-[21] w-full overflow-hidden rounded-lg border border-black-130 bg-white p-1 shadow-lg">
<div className="flex w-full flex-col gap-1">
{values.map((item, idx) => {
const isActive = value === item;
return (
Expand Down
1 change: 1 addition & 0 deletions dashboard/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = {
},
black: {
100: '#F4F9F9',
130: '#F4F2F7',
150: '#F5F5F5',
170: '#EDEBEE',
200: '#CFD7D7',
Expand Down