mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(post form): add on mobile
This commit is contained in:
@@ -22,7 +22,7 @@ const BoardNavDesktop = ({ subplebbitAddresses }: BoardNavProps) => {
|
|||||||
<span key={index}>
|
<span key={index}>
|
||||||
{index === 0 ? null : ' '}
|
{index === 0 ? null : ' '}
|
||||||
<Link to={`/p/${address}${isInCatalogView ? '/catalog' : ''}`}>{address.includes('.') ? address : address.slice(0, 10).concat('...')}</Link>
|
<Link to={`/p/${address}${isInCatalogView ? '/catalog' : ''}`}>{address.includes('.') ? address : address.slice(0, 10).concat('...')}</Link>
|
||||||
{index !== address.length - 1 ? ' /' : null}
|
{index !== subplebbitAddresses.length - 1 ? ' /' : null}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -1,15 +1,24 @@
|
|||||||
.postFormButtonDesktop {
|
.postFormTable {
|
||||||
font-size: var(--post-form-toggle-font-size);
|
font-size: var(--post-form-toggle-font-size);
|
||||||
font-weight: var(--post-form-toggle-font-weight);
|
font-weight: var(--post-form-toggle-font-weight);
|
||||||
text-align: center;
|
width: auto;
|
||||||
|
text-align: left;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
display: table;
|
||||||
|
border-spacing: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.postFormButtonMobile {
|
.postFormMobile {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-top: 9px;
|
padding-top: 9px;
|
||||||
padding-bottom: 0.5em;
|
padding-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.postFormMobile .showFormButton {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.closed {
|
.closed {
|
||||||
font-size: x-large;
|
font-size: x-large;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -19,15 +28,7 @@
|
|||||||
padding-bottom: 100px;
|
padding-bottom: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.postFormButtonDesktop table {
|
.postFormTable td:first-child {
|
||||||
display: table;
|
|
||||||
border-spacing: 1px;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.postFormButtonDesktop td:first-child {
|
|
||||||
background-color: var(--post-form-field-title-background-color);
|
background-color: var(--post-form-field-title-background-color);
|
||||||
color: var(--post-form-field-title-color);
|
color: var(--post-form-field-title-color);
|
||||||
font-weight: var(--post-form-field-title-font-weight);
|
font-weight: var(--post-form-field-title-font-weight);
|
||||||
@@ -37,14 +38,14 @@
|
|||||||
width: 80px;
|
width: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.postFormButtonDesktop td {
|
.postFormTable td {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.postFormButtonDesktop input[type="text"], .postFormButtonDesktop textarea {
|
.postFormTable input[type="text"], .postFormTable textarea {
|
||||||
border: var(--post-form-field-input-border, revert);
|
border: var(--post-form-field-input-border, revert);
|
||||||
font-family: var(--post-form-field-font-family, revert);
|
font-family: var(--post-form-field-font-family, revert);
|
||||||
appearance: var(--post-form-field-input-appearance, revert);
|
appearance: var(--post-form-field-input-appearance, revert);
|
||||||
@@ -56,22 +57,22 @@
|
|||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
.postFormButtonDesktop input[type="text"]:focus, .postFormButtonDesktop textarea:focus {
|
.postFormTable input[type="text"]:focus, .postFormTable textarea:focus {
|
||||||
border: var(--post-form-field-input-focus-border, revert);
|
border: var(--post-form-field-input-focus-border, revert);
|
||||||
}
|
}
|
||||||
|
|
||||||
.postFormButtonDesktop td > input[type="text"] {
|
.postFormTable td > input[type="text"] {
|
||||||
width: 244px;
|
width: 244px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.postFormButtonDesktop textarea {
|
.postFormTable textarea {
|
||||||
width: 292px;
|
width: 292px;
|
||||||
|
|
||||||
/* textareas have a gap below them that differs along browsers https://stackoverflow.com/a/7144960 */
|
/* textareas have a gap below them that differs along browsers https://stackoverflow.com/a/7144960 */
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.postFormButtonDesktop button {
|
.postFormTable button {
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
filter: var(--filter80);
|
filter: var(--filter80);
|
||||||
}
|
}
|
||||||
@@ -85,13 +86,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
.postFormButtonDesktop {
|
.postFormDesktop {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 640px) {
|
@media (min-width: 640px) {
|
||||||
.postFormButtonMobile {
|
.postFormMobile {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ const PostFormTable = () => {
|
|||||||
const [link, setLink] = useState('');
|
const [link, setLink] = useState('');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<table>
|
<table className={styles.postFormTable}>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Name</td>
|
<td>Name</td>
|
||||||
@@ -74,7 +74,7 @@ const PostForm = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.postFormButtonDesktop}>
|
<div className={styles.postFormDesktop}>
|
||||||
{isThreadClosed ? (
|
{isThreadClosed ? (
|
||||||
<div className={styles.closed}>
|
<div className={styles.closed}>
|
||||||
{t('thread_closed')}
|
{t('thread_closed')}
|
||||||
@@ -93,7 +93,7 @@ const PostForm = () => {
|
|||||||
<PostFormTable />
|
<PostFormTable />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.postFormButtonMobile}>
|
<div className={styles.postFormMobile}>
|
||||||
{isThreadClosed ? (
|
{isThreadClosed ? (
|
||||||
<div className={styles.closed}>
|
<div className={styles.closed}>
|
||||||
{t('thread_closed')}
|
{t('thread_closed')}
|
||||||
@@ -101,9 +101,12 @@ const PostForm = () => {
|
|||||||
{t('may_not_reply')}
|
{t('may_not_reply')}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<button className='button' onClick={() => setShowForm(true)}>
|
<>
|
||||||
{isInPostPage ? t('post_a_reply') : t('start_new_thread')}
|
<button className={`${styles.showFormButton} button`} onClick={() => setShowForm(showForm ? false : true)}>
|
||||||
</button>
|
{showForm ? t('close_post_form') : isInPostPage ? t('post_a_reply') : t('start_new_thread')}
|
||||||
|
</button>
|
||||||
|
{showForm && <PostFormTable />}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user