-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability to customise import statement for icon. (#13)
* feat: add base customize modal * feat: collection action modal base * feat: collection actions base * update * add drag sort collection action * feat: save to db and icon update * feat: customize copy action name and template string * copy right section button update * typescript fix
- Loading branch information
Showing
44 changed files
with
900 additions
and
140 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
31 changes: 0 additions & 31 deletions
31
src/components/modules/IconsHome/IconCardsSection/IconContextMenu/utils/deleteIcon.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
src/components/modules/IconsHome/IconCardsSection/IconContextMenu/utils/index.ts
This file was deleted.
Oops, something went wrong.
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
89 changes: 89 additions & 0 deletions
89
...odules/IconsHome/LeftIconsCollectionsNav/CustomizeActionsModal/ActionsList/ActionItem.tsx
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,89 @@ | ||
import { CollectionAction } from 'data/collections'; | ||
import { inlineIconsMap } from 'data/collections/iconActions/inlineIconsMap'; | ||
import { FC } from 'react'; | ||
import { ReactComponent as EditIcon } from 'assets/icons/pencil-alt.svg'; | ||
import { ReactComponent as EyeIcon } from 'assets/icons/eye.svg'; | ||
import { ReactComponent as EyeOffIcon } from 'assets/icons/eye-off.svg'; | ||
import { useSortable } from '@dnd-kit/sortable'; | ||
import { CSS } from '@dnd-kit/utilities'; | ||
import { ReactComponent as DragHandleIcon } from 'assets/icons/drag-handle.svg'; | ||
import { ActionsListProps } from '.'; | ||
|
||
interface Props | ||
extends Omit<ActionsListProps, 'actionItems' | 'setActionItems'> { | ||
item: CollectionAction; | ||
onActionChange: (selectedAction: CollectionAction) => void; | ||
} | ||
|
||
export const ActionItem: FC<Props> = ({ | ||
item, | ||
onEditClick, | ||
onActionChange, | ||
}) => { | ||
const icon = inlineIconsMap[item.icon]; | ||
|
||
const onVisibleChange = () => { | ||
onActionChange({ ...item, hidden: !item.hidden }); | ||
}; | ||
|
||
const { | ||
attributes, | ||
listeners, | ||
setNodeRef, | ||
transform, | ||
transition, | ||
isSorting, | ||
} = useSortable({ id: item.id }); | ||
|
||
const style = { | ||
transform: CSS.Transform.toString(transform), | ||
transition, | ||
zIndex: !transition ? 1 : 0, | ||
}; | ||
|
||
return ( | ||
<div | ||
className="group py-1 border-b border-gray-400 relative flex bg-gray-600" | ||
ref={setNodeRef} | ||
style={style} | ||
> | ||
<div className="text-gray-200 group flex items-center w-full outline-none px-2 py-2 text-sm"> | ||
<div className="mr-2">{icon}</div> | ||
{item.name} | ||
</div> | ||
|
||
<div | ||
{...attributes} | ||
{...listeners} | ||
className="flex items-center mr-1 outline-none" | ||
> | ||
<DragHandleIcon /> | ||
</div> | ||
|
||
<div | ||
className={`${ | ||
!isSorting && 'group-hover:opacity-100' | ||
} opacity-10 w-0 h-full relative top-0 -right-2`} | ||
> | ||
<div className="absolute px-2 py-2 flex gap-3"> | ||
{item.isEditable && ( | ||
<button | ||
className="outline-none" | ||
type="button" | ||
onClick={() => onEditClick(item)} | ||
> | ||
<EditIcon /> | ||
</button> | ||
)} | ||
<button | ||
className="outline-none" | ||
type="button" | ||
onClick={onVisibleChange} | ||
> | ||
{item.hidden ? <EyeOffIcon /> : <EyeIcon />} | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
10 changes: 10 additions & 0 deletions
10
...ules/IconsHome/LeftIconsCollectionsNav/CustomizeActionsModal/ActionsList/TempIconCard.tsx
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,10 @@ | ||
import { FC } from 'react'; | ||
import { ReactComponent as MailIcon } from 'assets/icons/mail.svg'; | ||
|
||
export const TempIconCard: FC = () => { | ||
return ( | ||
<div className="w-20 h-20 rounded-2xl bg-black2 flex flex-col items-center justify-center border border-gray-600"> | ||
<MailIcon /> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.