Skip to content

Commit

Permalink
Added styling to dropdown and fixed the trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteAsian123 committed Nov 9, 2023
1 parent 4282ceb commit 72fbf68
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 26 deletions.
37 changes: 21 additions & 16 deletions src/components/DropdownButton/DropdownButton.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,40 @@

.dropdown_content {
width: 300px;
background-color: white;
border-radius: 6px;
background: var(--sideBar_background);

border-radius: 8px;
padding: 5px;

box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2);
animation-duration: 400ms;
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
will-change: transform, opacity;
}

.dropdown_item {
font-size: 16px;
line-height: 1;
color: var(--violet-11);
border-radius: 3px;
display: flex;
align-items: center;
height: 25px;
padding: 0 5px;
position: relative;
padding-left: 25px;
user-select: none;

border-radius: 8px;
padding: 15px;

font-size: 14px;
font-weight: 700;
text-transform: uppercase;
background: rgba(255, 255, 255, 0);

color: var(--primary);

transition: background 0.1s;

outline: none;
user-select: none;
cursor: pointer;
}

.dropdown_item[data-highlighted] {
background-color: var(--violet-9);
color: var(--violet-1);
background: var(--sideBar_selection);
}

.dropdown_arrow {
fill: white;
fill: var(--sideBar_background);
}
20 changes: 12 additions & 8 deletions src/components/DropdownButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ const DropdownButton: React.FC<DropdownProps> = (props: DropdownProps) => {
} = props;

return <DropdownMenu.Root>
<DropdownMenu.Trigger asChild>
<div className={[styles.container, className].join(" ")} style={style}>
<Button {...buttonProps as ButtonProps} className={styles.button}>
{children}
</Button>
<div className={[styles.container, className].join(" ")} style={style}>
<Button {...buttonProps as ButtonProps} className={styles.button}>
{children}
</Button>
<DropdownMenu.Trigger asChild>
<button className={styles.dropdown_button}>
<DropdownIcon width={12} height={12} />
</button>
</div>
</DropdownMenu.Trigger>
</DropdownMenu.Trigger>
</div>

<DropdownMenu.Portal>
<DropdownMenu.Content className={styles.dropdown_content} sideOffset={5}>
<DropdownMenu.Content
className={styles.dropdown_content}
sideOffset={5}
align="end">

{dropdownChildren}
<DropdownMenu.Arrow className={styles.dropdown_arrow} />
</DropdownMenu.Content>
Expand Down
6 changes: 6 additions & 0 deletions src/components/Launch/LaunchButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export function LaunchButton(props: LaunchButtonProps) {
</>;

const dropdownChildren = <>
<DropdownItem>
Open Folder
</DropdownItem>
<DropdownItem>
Clear Caches
</DropdownItem>
<DropdownItem>
Uninstall
</DropdownItem>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Sidebar/Sidebar.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.sidebar {
width: 300px;
padding: 15px;

background: var(--sideBar_background);
color: var(--primary);

Expand Down Expand Up @@ -49,7 +49,7 @@
.button {
display: flex;
gap: 10px;

background: rgba(255, 255, 255, 0);
border-radius: 13px;

Expand Down
1 change: 1 addition & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

--sideBar_background: #05060B;
--sideBar_separator_color: #394452;
--sideBar_selection: rgba(255, 255, 255, 0.1);

--button_green: #46E74F;
--button_blue: #2ED9FF;
Expand Down

0 comments on commit 72fbf68

Please sign in to comment.