Improve create fold button with icon and 'New' label
This commit is contained in:
parent
b95f258763
commit
d6b855f0de
|
@ -4,6 +4,7 @@ export function ConfirmationButton(props: {
|
||||||
id: string
|
id: string
|
||||||
openModelBtn: {
|
openModelBtn: {
|
||||||
label: string
|
label: string
|
||||||
|
icon?: any
|
||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
cancelBtn?: {
|
cancelBtn?: {
|
||||||
|
@ -25,7 +26,7 @@ export function ConfirmationButton(props: {
|
||||||
htmlFor={id}
|
htmlFor={id}
|
||||||
className={clsx('btn modal-button', openModelBtn.className)}
|
className={clsx('btn modal-button', openModelBtn.className)}
|
||||||
>
|
>
|
||||||
{openModelBtn.label}
|
{openModelBtn.icon} {openModelBtn.label}
|
||||||
</label>
|
</label>
|
||||||
<input type="checkbox" id={id} className="modal-toggle" />
|
<input type="checkbox" id={id} className="modal-toggle" />
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
import { PlusCircleIcon } from '@heroicons/react/solid'
|
||||||
import { parseWordsAsTags } from '../../common/util/parse'
|
import { parseWordsAsTags } from '../../common/util/parse'
|
||||||
import { createFold } from '../lib/firebase/api-call'
|
import { createFold } from '../lib/firebase/api-call'
|
||||||
import { foldPath } from '../lib/firebase/folds'
|
import { foldPath } from '../lib/firebase/folds'
|
||||||
|
@ -49,7 +50,8 @@ export function CreateFoldButton() {
|
||||||
<ConfirmationButton
|
<ConfirmationButton
|
||||||
id="create-fold"
|
id="create-fold"
|
||||||
openModelBtn={{
|
openModelBtn={{
|
||||||
label: 'New community',
|
label: 'New',
|
||||||
|
icon: <PlusCircleIcon className="w-5 h-5 mr-2" />,
|
||||||
className: clsx(
|
className: clsx(
|
||||||
isSubmitting ? 'loading btn-disabled' : 'btn-primary',
|
isSubmitting ? 'loading btn-disabled' : 'btn-primary',
|
||||||
'btn-sm'
|
'btn-sm'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user