Skip to content

Commit

Permalink
feat: add share modal
Browse files Browse the repository at this point in the history
  • Loading branch information
remvze committed Jan 2, 2024
1 parent 26bf016 commit 35e3215
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
27 changes: 27 additions & 0 deletions src/components/menu/items/share/share.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
.heading {
font-family: var(--font-heading);
font-size: var(--font-md);
font-weight: 700;
}

.desc {
margin-top: 12px;
line-height: 1.6;
color: var(--color-foreground-subtle);
}

.inputWrapper {
display: flex;
align-items: center;
width: 100%;
height: 45px;
margin-top: 12px;
background-color: var(--color-neutral-50);
border: 1px solid var(--color-neutral-200);
border-radius: 4px;

& input {
flex-grow: 1;
height: 100%;
color: red;
background: transparent;
border: none;
outline: none;
}
}
13 changes: 12 additions & 1 deletion src/components/menu/items/share/share.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useState } from 'react';
import { createPortal } from 'react-dom';
import { IoCopyOutline } from 'react-icons/io5/index';

import { Modal } from '@/components/modal';

Expand All @@ -16,7 +17,17 @@ export function Share() {

{createPortal(
<Modal show={isModalOpen} onClose={() => setIsModalOpen(false)}>
<h1 className={styles.heading}>Share Sounds!</h1>
<h1 className={styles.heading}>Share your sound selection!</h1>
<p className={styles.desc}>
Copy and send the following link to the person you want to share
your selection with.
</p>
<div className={styles.inputWrapper}>
<input type="text" onFocus={e => e.stopPropagation()} />
<button>
<IoCopyOutline />
</button>
</div>
</Modal>,
document.body,
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function Menu() {

<AnimatePresence>
{isOpen && (
<FloatingFocusManager context={context} modal={false}>
<FloatingFocusManager context={context}>
<div
ref={refs.setFloating}
style={floatingStyles}
Expand Down

0 comments on commit 35e3215

Please sign in to comment.