generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin/organizer): improve usability
- Loading branch information
1 parent
8e9d6bf
commit a89ca56
Showing
12 changed files
with
116 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import * as React from "react"; | ||
import { motion } from "framer-motion"; | ||
|
||
// Base Folder Button Component | ||
const BaseFolderButton: React.FC<{ | ||
folder: string; | ||
onClick: (folder: string) => void; | ||
className?: string; | ||
score?: number; | ||
reason?: string; | ||
}> = ({ folder, onClick, className, score, reason }) => ( | ||
<motion.button | ||
className={`px-3 py-1 rounded-md transition-colors duration-200 shadow-none ${className}`} | ||
onClick={() => onClick(folder)} | ||
initial={{ opacity: 0, scale: 0.8 }} | ||
animate={{ opacity: 1, scale: 1 }} | ||
exit={{ opacity: 0, scale: 0.8 }} | ||
transition={{ duration: 0.2 }} | ||
title={`Score: ${score}, Reason: ${reason}`} | ||
> | ||
{folder} | ||
</motion.button> | ||
); | ||
|
||
// Existing Folder Button Component | ||
export const ExistingFolderButton: React.FC<{ | ||
folder: string; | ||
onClick: (folder: string) => void; | ||
score: number; | ||
reason: string; | ||
}> = props => ( | ||
<BaseFolderButton | ||
{...props} | ||
className="bg-[--background-secondary] text-[--text-normal] hover:bg-[--interactive-accent] hover:text-[--text-on-accent] border border-solid border-[--background-modifier-border]" | ||
/> | ||
); | ||
|
||
// New Folder Button Component | ||
export const NewFolderButton: React.FC<{ | ||
folder: string; | ||
onClick: (folder: string) => void; | ||
score: number; | ||
reason: string; | ||
}> = props => ( | ||
<BaseFolderButton | ||
{...props} | ||
className="bg-[--background-secondary] text-[--text-normal] hover:bg-[--interactive-accent] hover:text-[--text-on-accent] border border-dashed border-[--text-muted]" | ||
/> | ||
); |
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
Oops, something went wrong.