mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
Добавили заметки в сайдбар (#126)
* added notes sidebar * added note dropping and editing * added sidebar navigation * handling sidebarchanges over time * using router back for closing sidebar * fixed tripping inside single sidebar * added superpowers toggle to sidebar * user button opens sidebar now * added profile cover for profile sidebar * removed profile sidebar completely * ran prettier over project * added note not found error literal
This commit is contained in:
parent
fe3db608d6
commit
5d34090238
72 changed files with 1241 additions and 664 deletions
|
@ -1,13 +1,21 @@
|
|||
import React, { DetailedHTMLProps, FC, HTMLAttributes } from 'react';
|
||||
import React, { DetailedHTMLProps, VFC, HTMLAttributes } from 'react';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import styles from '~/styles/common/markdown.module.scss';
|
||||
import { formatText } from '~/utils/dom';
|
||||
|
||||
interface IProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {}
|
||||
interface IProps
|
||||
extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
||||
children?: string;
|
||||
}
|
||||
|
||||
const Markdown: FC<IProps> = ({ className, ...props }) => (
|
||||
<div className={classNames(styles.wrapper, className)} {...props} />
|
||||
const Markdown: VFC<IProps> = ({ className, children = '', ...props }) => (
|
||||
<div
|
||||
className={classNames(styles.wrapper, className)}
|
||||
{...props}
|
||||
dangerouslySetInnerHTML={{ __html: formatText(children) }}
|
||||
/>
|
||||
);
|
||||
|
||||
export { Markdown };
|
||||
|
|
|
@ -1,22 +1,26 @@
|
|||
import React, { FC } from "react";
|
||||
import React, { FC } from 'react';
|
||||
|
||||
import classNames from "classnames";
|
||||
import classNames from 'classnames';
|
||||
|
||||
import styles from "./styles.module.scss";
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
interface ZoneProps {
|
||||
title?: string;
|
||||
className?: string;
|
||||
color?: "danger" | "normal";
|
||||
color?: 'danger' | 'normal';
|
||||
}
|
||||
|
||||
const Zone: FC<ZoneProps> = ({
|
||||
title,
|
||||
className,
|
||||
children,
|
||||
color = "normal",
|
||||
color = 'normal',
|
||||
}) => (
|
||||
<div className={classNames(className, styles.pad, styles[color])}>
|
||||
<div
|
||||
className={classNames(className, styles.pad, styles[color], {
|
||||
[styles.with_title]: !!title,
|
||||
})}
|
||||
>
|
||||
{!!title && (
|
||||
<div className={styles.title}>
|
||||
<span>{title}</span>
|
||||
|
|
|
@ -8,7 +8,7 @@ $pad_usual: mix(white, $content_bg, 10%);
|
|||
|
||||
span {
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
top: -$gap;
|
||||
left: $radius;
|
||||
transform: translate(0, -100%);
|
||||
background: $pad_usual;
|
||||
|
@ -25,7 +25,7 @@ $pad_usual: mix(white, $content_bg, 10%);
|
|||
}
|
||||
|
||||
.pad {
|
||||
padding: $gap * 1.5 $gap $gap;
|
||||
padding: $gap;
|
||||
box-shadow: inset $pad_usual 0 0 0 2px;
|
||||
border-radius: $radius;
|
||||
position: relative;
|
||||
|
@ -33,4 +33,8 @@ $pad_usual: mix(white, $content_bg, 10%);
|
|||
&.danger {
|
||||
box-shadow: inset $pad_danger 0 0 0 2px;
|
||||
}
|
||||
|
||||
&.with_title {
|
||||
padding-top: $gap * 2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue