-
Notifications
You must be signed in to change notification settings - Fork 1
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
[feat] Custom Examples #128
base: dev
Are you sure you want to change the base?
Conversation
Denis-Dinkov
commented
Oct 30, 2024
- Load custom examples
- Save and edit examples
- Improve UI
- Fix authorization issues
- Share examples
- Load examples from other users
Visit the preview URL for this PR (updated for commit 2e52271): https://devground-dev--pr128-snippets-djl76of3.web.app (expires Tue, 12 Nov 2024 17:17:36 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: e50593071dcd46506823ee35f790c6b8712eb00e |
…rate into CustomExampleList
03ea99e
to
3c84d31
Compare
connectInjectedExtension, | ||
getInjectedExtensions, | ||
}); | ||
const initializeStores = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this async necessary? As far as I can see there are other async init store functions (initStoreAuth, initStoreChainClient)
src/views/codeEditor/components/selectExample/snippetList/customExamples.tsx
Outdated
Show resolved
Hide resolved
<li | ||
key={example.id} | ||
className={cn( | ||
'flex items-center justify-between', | ||
'transition-[background] duration-300', | ||
'cursor-pointer', | ||
'hover:bg-dev-black-900 hover:dark:bg-dev-purple-200', | ||
{ | ||
['bg-dev-black-800 dark:bg-dev-purple-300']: selectedExample === example.name, | ||
}, | ||
)} | ||
> | ||
<button | ||
data-example-index={example.id} | ||
onClick={handleChangeExample} | ||
className={cn( | ||
'flex w-full items-center justify-between', | ||
'px-4 py-3.5', | ||
)} | ||
> | ||
<p className="font-geist text-dev-white-200 font-body2-regular dark:text-dev-black-1000"> | ||
{truncateString(example.name, 60)} | ||
</p> | ||
</button> | ||
<div className={cn( | ||
'flex gap-2', | ||
'px-4 py-3.5', | ||
'text-dev-white-1000 dark:text-dev-black-300', | ||
)} | ||
> | ||
<span | ||
data-example-index={example.id} | ||
onClick={handleEditExample} | ||
> | ||
<Icon | ||
name="icon-pen" | ||
size={[17]} | ||
/> | ||
</span> | ||
<span | ||
data-example-index={example.id} | ||
onClick={handleDeleteExample} | ||
> | ||
<Icon | ||
name="icon-trash" | ||
size={[17]} | ||
/> | ||
</span> | ||
</div> | ||
</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth extracting this in separate component?
src/views/codeEditor/components/selectExample/snippetList/defaultExamples.tsx
Outdated
Show resolved
Hide resolved
Did we decided to remove the functionality for checking whether changes are made for the selected example and based on the result to show/hide save button? |
BUG:
Result: nothing is loaded (the url is not updated to point to the default example) |
BUG:
Result: redirected to the default example Expected: Blank example(should be confirmed) |
BUG:
Result: Still able to see the example code, also the select example dropdown still shows the deleted example name |
disable button on loading and change names
693af11
to
2e52271
Compare