Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
6290234a
Commit
6290234a
authored
Dec 19, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix button styles
parent
aeed2564
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
CodeBlock.tsx
web/src/components/MemoContentV1/CodeBlock.tsx
+15
-6
MobileHeader.tsx
web/src/components/MobileHeader.tsx
+1
-1
UserBanner.tsx
web/src/components/UserBanner.tsx
+2
-2
No files found.
web/src/components/MemoContentV1/CodeBlock.tsx
View file @
6290234a
import
{
IconButton
}
from
"@mui/joy"
;
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
import
copy
from
"copy-to-clipboard"
;
import
copy
from
"copy-to-clipboard"
;
import
hljs
from
"highlight.js"
;
import
hljs
from
"highlight.js"
;
import
toast
from
"react-hot-toast"
;
import
toast
from
"react-hot-toast"
;
import
Icon
from
"../Icon"
;
interface
Props
{
interface
Props
{
language
:
string
;
language
:
string
;
...
@@ -27,14 +29,21 @@ const CodeBlock: React.FC<Props> = ({ language, content }: Props) => {
...
@@ -27,14 +29,21 @@ const CodeBlock: React.FC<Props> = ({ language, content }: Props) => {
};
};
return
(
return
(
<
pre
className=
"group w-full my-1 p-3 rounded bg-gray-100 dark:bg-zinc-600 whitespace-pre-wrap relative"
>
<
pre
className=
"w-full my-1 p-3 rounded bg-gray-100 dark:bg-zinc-600 whitespace-pre-wrap relative"
>
<
button
<
IconButton
className=
"text-xs font-mono italic absolute top-0 right-0 px-2 leading-6 border btn-text rounded opacity-0 group-hover:opacity-60"
size=
"sm"
className=
"!absolute top-0.5 right-0.5 opacity-50"
sx=
{
{
"--IconButton-size"
:
"24px"
,
}
}
onClick=
{
handleCopyButtonClick
}
onClick=
{
handleCopyButtonClick
}
>
>
copy
<
Icon
.
Copy
className=
"w-4 h-auto"
/>
</
button
>
</
IconButton
>
<
code
className=
{
classNames
(
`language-${formatedLanguage}`
,
"block"
)
}
dangerouslySetInnerHTML=
{
{
__html
:
highlightedCode
}
}
></
code
>
<
code
className=
{
classNames
(
`language-${formatedLanguage}`
,
"block text-sm"
)
}
dangerouslySetInnerHTML=
{
{
__html
:
highlightedCode
}
}
></
code
>
</
pre
>
</
pre
>
);
);
};
};
...
...
web/src/components/MobileHeader.tsx
View file @
6290234a
...
@@ -17,7 +17,7 @@ const MobileHeader = (props: Props) => {
...
@@ -17,7 +17,7 @@ const MobileHeader = (props: Props) => {
return
(
return
(
<
div
<
div
className=
{
classNames
(
className=
{
classNames
(
"sticky top-0 pt-4 sm:pt-1 px-4 pb-1 mb-1 b
ackdrop-blur
flex md:hidden flex-row justify-between items-center w-full h-auto flex-nowrap shrink-0 z-2"
,
"sticky top-0 pt-4 sm:pt-1 px-4 pb-1 mb-1 b
g-zinc-100 dark:bg-zinc-800 bg-opacity-80 backdrop-blur-lg
flex md:hidden flex-row justify-between items-center w-full h-auto flex-nowrap shrink-0 z-2"
,
offsetTop
>
0
&&
"shadow-md"
offsetTop
>
0
&&
"shadow-md"
)
}
)
}
>
>
...
...
web/src/components/UserBanner.tsx
View file @
6290234a
...
@@ -33,12 +33,12 @@ const UserBanner = () => {
...
@@ -33,12 +33,12 @@ const UserBanner = () => {
};
};
return
(
return
(
<
div
className=
"
flex flex-row justify-between items-center relative w-full h-auto px-2 flex-nowrap
shrink-0"
>
<
div
className=
"
relative w-full h-auto px-2
shrink-0"
>
<
Dropdown
<
Dropdown
className=
"w-auto"
className=
"w-auto"
trigger=
{
trigger=
{
<
div
className=
"px-4 py-2 max-w-full flex flex-row justify-start items-center cursor-pointer rounded-2xl hover:shadow hover:bg-white dark:hover:bg-zinc-700"
>
<
div
className=
"px-4 py-2 max-w-full flex flex-row justify-start items-center cursor-pointer rounded-2xl hover:shadow hover:bg-white dark:hover:bg-zinc-700"
>
<
UserAvatar
className=
"shadow"
avatarUrl=
{
user
?.
avatarUrl
}
/>
<
UserAvatar
className=
"shadow
shrink-0
"
avatarUrl=
{
user
?.
avatarUrl
}
/>
<
span
className=
"px-1 text-lg font-medium text-slate-800 dark:text-gray-200 shrink truncate"
>
{
title
}
</
span
>
<
span
className=
"px-1 text-lg font-medium text-slate-800 dark:text-gray-200 shrink truncate"
>
{
title
}
</
span
>
{
user
?.
role
===
User_Role
.
HOST
?
(
{
user
?.
role
===
User_Role
.
HOST
?
(
<
span
className=
"text-xs px-1 bg-blue-600 dark:bg-blue-800 rounded text-white dark:text-gray-200 shadow"
>
MOD
</
span
>
<
span
className=
"text-xs px-1 bg-blue-600 dark:bg-blue-800 rounded text-white dark:text-gray-200 shadow"
>
MOD
</
span
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment