Merge pull request #374 from answerdev/feat/1.1.0/ui

Feat/1.1.0/UI
This commit is contained in:
dashuai 2023-05-26 18:25:39 +08:00 committed by GitHub
commit 31800e6f2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 37 deletions

View File

@ -1168,14 +1168,6 @@ ui:
accepted: Accepted accepted: Accepted
answered: answered answered: answered
asked: asked asked: asked
rank_type:
upvote: upvote
upvoted: upvoted
downvote: downvote
downvoted: downvoted
edit: edit
accept: accept
accepted: accepted
downvoted: downvoted downvoted: downvoted
mod_short: Mod mod_short: Mod
mod_long: Moderators mod_long: Moderators

View File

@ -1,28 +1,17 @@
// .flex-auto {
// max-width: 70%;
// }
.page-right-side { .page-right-side {
flex: none; flex: none;
width: 30%; width: 30%;
} }
.line {
position: absolute;
top: 0;
right: 12px;
width: 1px;
height: 100%;
background-color: var(--bs-gray-300);
min-height: calc(100vh - 62px - 74px);
}
// lg // lg
@media screen and (max-width: 1199.9px) { @media screen and (max-width: 1199.9px) {
// .flex-auto {
// max-width: 100%;
// }
.page-right-side { .page-right-side {
width: 100%; width: 100%;
} }
} }
// md
@media screen and (max-width: 991.9px) {
.line {
display: none;
}
}

View File

@ -94,13 +94,17 @@ export function htmlRender(el: HTMLElement | null) {
el.querySelectorAll('.language-mermaid').forEach((pre) => { el.querySelectorAll('.language-mermaid').forEach((pre) => {
const flag = Date.now(); const flag = Date.now();
mermaid.render(`theGraph${flag}`, pre.textContent, function (svgCode) { mermaid.render(
const p = document.createElement('p'); `theGraph${flag}`,
p.className = 'text-center'; pre.textContent || '',
p.innerHTML = svgCode; function (svgCode) {
const p = document.createElement('p');
p.className = 'text-center';
p.innerHTML = svgCode;
pre.parentNode?.replaceChild(p, pre); pre.parentNode?.replaceChild(p, pre);
}); },
);
}); });
}); });
import('katex/contrib/auto-render/auto-render').then( import('katex/contrib/auto-render/auto-render').then(

View File

@ -14,6 +14,15 @@
color: black; color: black;
background-color: var(--bs-gray-200); background-color: var(--bs-gray-200);
} }
.side-nav-right-line {
position: absolute;
top: 0;
right: 12px;
width: 1px;
height: 100%;
background-color: var(--bs-gray-300);
min-height: calc(100vh - 62px - 74px);
}
} }
@media screen and (max-width: 991.9px) { @media screen and (max-width: 991.9px) {
@ -21,5 +30,8 @@
.nav { .nav {
max-width: 100%; max-width: 100%;
} }
.side-nav-right-line {
display: none;
}
} }
} }

View File

@ -66,7 +66,7 @@ const Index: FC = () => {
</> </>
) : null} ) : null}
</Nav> </Nav>
<div className="line" /> <div className="side-nav-right-line" />
</Col> </Col>
); );
}; };

View File

@ -1,6 +1,5 @@
import { FC, memo } from 'react'; import { FC, memo } from 'react';
import { ListGroup, ListGroupItem } from 'react-bootstrap'; import { ListGroup, ListGroupItem } from 'react-bootstrap';
import { useTranslation } from 'react-i18next';
import { FormatTime } from '@/components'; import { FormatTime } from '@/components';
import { pathFactory } from '@/router/pathFactory'; import { pathFactory } from '@/router/pathFactory';
@ -11,7 +10,6 @@ interface Props {
} }
const Index: FC<Props> = ({ visible, data }) => { const Index: FC<Props> = ({ visible, data }) => {
const { t } = useTranslation('translation', { keyPrefix: 'personal' });
if (!visible || !data?.length) { if (!visible || !data?.length) {
return null; return null;
} }
@ -48,9 +46,7 @@ const Index: FC<Props> = ({ visible, data }) => {
{item.title} {item.title}
</a> </a>
<div className="d-flex align-items-center small text-secondary"> <div className="d-flex align-items-center small text-secondary">
<span> <span>{item.rank_type}</span>
{t(item.rank_type, { keyPrefix: 'personal.rank_type' })}
</span>
<span className="split-dot" /> <span className="split-dot" />
<FormatTime time={item.created_at} className="me-4" /> <FormatTime time={item.created_at} className="me-4" />
</div> </div>