mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
refactor(modals): split directory modal into separate create board modal
Separate DirectoryModal (for home view placeholders) and CreateBoardModal (for board view create button) into distinct components with their own stores, allowing independent styling and cleaner separation of concerns.
This commit is contained in:
@@ -2,7 +2,7 @@ import useDirectoryModalStore from '../../stores/use-directory-modal-store';
|
||||
import styles from './directory-modal.module.css';
|
||||
|
||||
const DirectoryModal = () => {
|
||||
const { showModal, modalContext, closeDirectoryModal } = useDirectoryModalStore();
|
||||
const { showModal, closeDirectoryModal } = useDirectoryModalStore();
|
||||
|
||||
if (!showModal) {
|
||||
return null;
|
||||
@@ -14,33 +14,27 @@ const DirectoryModal = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const isPlaceholderContext = modalContext === 'placeholder';
|
||||
|
||||
return (
|
||||
<div className={styles.backdrop} onClick={handleBackdropClick}>
|
||||
<div className={styles.directoryDialog}>
|
||||
<div className={styles.hd}>
|
||||
<h2>{isPlaceholderContext ? 'Submit a Board to a Directory' : 'Create a Board'}</h2>
|
||||
<h2>Submit a Board to a Directory</h2>
|
||||
<button className={styles.closeButton} onClick={closeDirectoryModal} title='Close' />
|
||||
</div>
|
||||
<div className={styles.bd}>
|
||||
{isPlaceholderContext && (
|
||||
<p className={styles.introMessage}>
|
||||
<strong>The board you clicked on doesn't exist yet, but it can be yours!</strong>
|
||||
</p>
|
||||
)}
|
||||
<p className={styles.introMessage}>
|
||||
<strong>The board you clicked on doesn't exist yet, but it can be yours!</strong>
|
||||
</p>
|
||||
|
||||
{isPlaceholderContext && (
|
||||
<div className={styles.section}>
|
||||
<h3>Directory vs Regular Board</h3>
|
||||
<p>
|
||||
A "directory board" is assigned to a category on the homepage (like "Anime & Manga" or "Video Games"). Directory assignments
|
||||
are temporary and handpicked by devs until DAO curation is implemented.{' '}
|
||||
<strong>Anyone can create a board and users can access it anytime using its address</strong>—use the search bar, direct links, or the
|
||||
"[Subscribe]" button to access boards regardless of directory assignment.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.section}>
|
||||
<h3>Directory vs Regular Board</h3>
|
||||
<p>
|
||||
A "directory board" is assigned to a category on the homepage (like "Anime & Manga" or "Video Games"). Directory assignments
|
||||
are temporary and handpicked by devs until DAO curation is implemented.{' '}
|
||||
<strong>Anyone can create a board and users can access it anytime using its address</strong>—use the search bar, direct links, or the
|
||||
"[Subscribe]" button to access boards regardless of directory assignment.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className={styles.section}>
|
||||
<h3>Creating Your Board</h3>
|
||||
@@ -58,15 +52,13 @@ const DirectoryModal = () => {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{isPlaceholderContext && (
|
||||
<div className={styles.section}>
|
||||
<h3>Directory Requirements</h3>
|
||||
<p>
|
||||
Boards need 99% uptime (they're P2P nodes), plus be active, well-moderated, and relevant to the category. Devs review and approve/reject based on
|
||||
these criteria.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.section}>
|
||||
<h3>Directory Requirements</h3>
|
||||
<p>
|
||||
Boards need 99% uptime (they're P2P nodes), plus be active, well-moderated, and relevant to the category. Devs review and approve/reject based on these
|
||||
criteria.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className={styles.section}>
|
||||
<h3>Submitting to a Directory</h3>
|
||||
|
||||
Reference in New Issue
Block a user