-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
522 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Icon } from '@iconify/react/dist/iconify.js'; | ||
import { usePlaylistView } from '@/app/context/PlaylistViewContext'; | ||
|
||
type DeleteOptionsTypes = { | ||
restoreOption: boolean; | ||
toggleRestoreOption: () => void; | ||
}; | ||
|
||
const DeleteOptions = ({ | ||
restoreOption, | ||
toggleRestoreOption, | ||
}: DeleteOptionsTypes) => { | ||
const { saveTracks, loading } = usePlaylistView(); | ||
|
||
return ( | ||
<div className='flex items-center gap-2 ml-auto'> | ||
<button | ||
onClick={toggleRestoreOption} | ||
className='flex items-center gap-1 text-fsm sm:text-fbase'> | ||
<span>Select Songs to Restore</span> | ||
{restoreOption ? ( | ||
<Icon icon='mingcute:up-line' /> | ||
) : ( | ||
<Icon icon='mingcute:down-line' /> | ||
)} | ||
</button> | ||
<button | ||
onClick={saveTracks} | ||
disabled={loading.isLoading} | ||
className='bg-brand px-4 py-1 rounded text-lightest text-fsm sm:text-fbase'> | ||
{loading.isLoading ? loading.message : 'Save'} | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DeleteOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Icon } from '@iconify/react/dist/iconify.js'; | ||
import { PlaylistViewProvider } from '@/app/context/PlaylistViewContext'; | ||
import StartedEditing from './StartedEditing'; | ||
import TrackList from './TrackList'; | ||
|
||
const OpenPlaylist = ({ handleClick }: { handleClick: () => void }) => { | ||
return ( | ||
<PlaylistViewProvider> | ||
<section className='h-screen w-screen fixed left-0 top-0 bg-slate-500 bg-opacity-60 z-50 flex items-center justify-center'> | ||
<div className='mt-6 relative bg-lightest dark:bg-darkest w-[90%] sm:w-3/5 rounded p-6 flex flex-col max-h-[90%] min-w-[300px]'> | ||
<div className='flex items-center justify-between sticky top-0 w-full text-fmd pr-2 pb-2'> | ||
<p>Edit Playlist Generated</p> | ||
|
||
<button onClick={handleClick} className='flex gap-1 items-center'> | ||
<Icon icon='iconoir:cancel' width='20' height='20' /> | ||
<span>Close</span> | ||
</button> | ||
</div> | ||
<TrackList /> | ||
<StartedEditing /> | ||
</div> | ||
</section> | ||
</PlaylistViewProvider> | ||
); | ||
}; | ||
|
||
export default OpenPlaylist; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { usePlaylistView } from '@/app/context/PlaylistViewContext'; | ||
|
||
type RestoreOptionsTypes = { | ||
selectedTracksToRestore: string[]; | ||
handleRestoreSelected: () => void; | ||
}; | ||
|
||
const RestoreOptions = ({ | ||
selectedTracksToRestore, | ||
handleRestoreSelected, | ||
}: RestoreOptionsTypes) => { | ||
const { restoreAllTracks } = usePlaylistView(); | ||
|
||
return ( | ||
<div className='flex items-center gap-5'> | ||
<button | ||
onClick={restoreAllTracks} | ||
className='border-brand border-2 px-4 py-1 rounded text-fsm mb-3 transition-all hover:bg-brand hover:text-lightest'> | ||
Restore All | ||
</button> | ||
{selectedTracksToRestore.length > 0 && ( | ||
<button | ||
className='border-brand border-2 px-4 py-1 rounded text-fsm mb-3 transition-all hover:bg-brand hover:text-lightest' | ||
onClick={handleRestoreSelected}> | ||
Restore Selected | ||
</button> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default RestoreOptions; |
Oops, something went wrong.