mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
#58 fixed lab detection at create dialog
This commit is contained in:
parent
e5ed6361e6
commit
558a97d278
3 changed files with 14 additions and 2 deletions
|
@ -1,5 +1,14 @@
|
||||||
@import "~/styles/variables.scss";
|
@import "~/styles/variables.scss";
|
||||||
|
|
||||||
|
@keyframes appear {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.wrap {
|
.wrap {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -11,6 +20,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
animation: appear 0.25s forwards;
|
||||||
|
|
||||||
@include can_backdrop {
|
@include can_backdrop {
|
||||||
backdrop-filter: blur(15px);
|
backdrop-filter: blur(15px);
|
||||||
|
|
|
@ -21,7 +21,9 @@ const EditorCreateDialog: FC = () => {
|
||||||
|
|
||||||
const isExist = useMemo(() => values(NODE_TYPES).some(el => el === type), [type]);
|
const isExist = useMemo(() => values(NODE_TYPES).some(el => el === type), [type]);
|
||||||
|
|
||||||
const data = useRef({ ...EMPTY_NODE, type });
|
const isInLab = useMemo(() => !!url.match(/^\/lab/), [url]);
|
||||||
|
|
||||||
|
const data = useRef({ ...EMPTY_NODE, type, is_promoted: !isInLab });
|
||||||
|
|
||||||
if (!type || !isExist) {
|
if (!type || !isExist) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -23,7 +23,7 @@ const MainRouter: FC<IProps> = () => {
|
||||||
<Route path={URLS.ERRORS.NOT_FOUND} component={ErrorNotFound} />
|
<Route path={URLS.ERRORS.NOT_FOUND} component={ErrorNotFound} />
|
||||||
<Route path={URLS.PROFILE_PAGE(':username')} component={ProfilePage} />
|
<Route path={URLS.PROFILE_PAGE(':username')} component={ProfilePage} />
|
||||||
|
|
||||||
{is_user && <Route exact path={URLS.LAB} component={LabLayout} />}
|
{is_user && <Route path={URLS.LAB} component={LabLayout} />}
|
||||||
|
|
||||||
<Route path={URLS.BASE} component={FlowLayout} />
|
<Route path={URLS.BASE} component={FlowLayout} />
|
||||||
<Redirect to="/" />
|
<Redirect to="/" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue