Disable last dialog, fix markdown preview
This commit is contained in:
parent
f608f722da
commit
1b1352df47
|
@ -11,7 +11,6 @@ import { Config as ConfigType } from '@speedy-tuner/types';
|
|||
import Dialog from '../components/Tune/Dialog';
|
||||
import SideBar, { DialogMatchedPathType } from '../components/Tune/SideBar';
|
||||
import { Routes } from '../routes';
|
||||
import useBrowserStorage from '../hooks/useBrowserStorage';
|
||||
import useConfig from '../hooks/useConfig';
|
||||
import {
|
||||
AppState,
|
||||
|
@ -26,8 +25,8 @@ const mapStateToProps = (state: AppState) => ({
|
|||
|
||||
const Tune = ({ navigation, config }: { navigation: NavigationState, config: ConfigType }) => {
|
||||
const { pathname } = useLocation();
|
||||
const { storageGetSync } = useBrowserStorage();
|
||||
const lastDialogPath = storageGetSync('lastDialog');
|
||||
// const { storageGetSync } = useBrowserStorage();
|
||||
// const lastDialogPath = storageGetSync('lastDialog');
|
||||
const { isConfigReady } = useConfig(config);
|
||||
const dialogMatchedPath: DialogMatchedPathType = useMemo(() => matchPath(pathname, {
|
||||
path: Routes.TUNE_DIALOG,
|
||||
|
@ -51,7 +50,7 @@ const Tune = ({ navigation, config }: { navigation: NavigationState, config: Con
|
|||
return (
|
||||
<>
|
||||
<Route path={Routes.TUNE_TUNE} exact>
|
||||
{firstDialogPath && <Redirect to={lastDialogPath || firstDialogPath} />}
|
||||
{firstDialogPath && <Redirect to={firstDialogPath} />}
|
||||
</Route>
|
||||
<SideBar matchedPath={dialogMatchedPath} />
|
||||
<Dialog
|
||||
|
|
|
@ -139,6 +139,7 @@ const UploadPage = () => {
|
|||
const publish = async (values: any) => {
|
||||
setIsLoading(true);
|
||||
await updateData(newTuneId!, {
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
isPublished: true,
|
||||
isListed: values.isListed,
|
||||
|
@ -585,7 +586,7 @@ const UploadPage = () => {
|
|||
</Item>
|
||||
</Tabs.TabPane>
|
||||
<Tabs.TabPane tab="Preview" key="preview" style={{ height: descriptionEditorHeight }}>
|
||||
<div className="markdown-preview" style={{ height: '100%' }}>
|
||||
<div className="markdown-preview">
|
||||
<ReactMarkdown>
|
||||
{readme}
|
||||
</ReactMarkdown>
|
||||
|
|
Loading…
Reference in New Issue