-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(articles): Style ul, style mode buttons, remove ipfs url hack
- Loading branch information
Showing
7 changed files
with
108 additions
and
51 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
packages/screens/FeedNewArticle/components/ArticleContentEditor/Toolbar/ModeButtons.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { Dispatch, FC, SetStateAction, useState } from "react"; | ||
|
||
import eyeSVG from "@/assets/icons/eye.svg"; | ||
import penSVG from "@/assets/icons/pen.svg"; | ||
import splittedSquareSVG from "@/assets/icons/splitted-square.svg"; | ||
import { SVG } from "@/components/SVG"; | ||
import { CustomPressable } from "@/components/buttons/CustomPressable"; | ||
import { SpacerRow } from "@/components/spacer"; | ||
import { ContentMode } from "@/utils/feed/markdown"; | ||
import { neutral11, neutral33, neutralFF } from "@/utils/style/colors"; | ||
import { layout } from "@/utils/style/layout"; | ||
|
||
interface Props { | ||
setMode: Dispatch<SetStateAction<ContentMode>>; | ||
mode: ContentMode; | ||
} | ||
|
||
export const ModeButtons: FC<Props> = ({ setMode, mode }) => { | ||
const [hoveredButton, setHoveredButton] = useState<ContentMode | null>(null); | ||
|
||
return ( | ||
<> | ||
<CustomPressable | ||
onPress={() => setMode("EDITION")} | ||
style={{ | ||
backgroundColor: mode === "EDITION" ? neutral33 : neutral11, | ||
padding: layout.spacing_x0_5, | ||
borderRadius: 6, | ||
borderWidth: 1, | ||
borderColor: hoveredButton === "EDITION" ? neutralFF : neutral11, | ||
}} | ||
onHoverIn={() => setHoveredButton("EDITION")} | ||
onHoverOut={() => setHoveredButton(null)} | ||
> | ||
<SVG source={penSVG} height={24} width={24} color={neutralFF} /> | ||
</CustomPressable> | ||
<SpacerRow size={1} /> | ||
<CustomPressable | ||
onPress={() => setMode("BOTH")} | ||
style={{ | ||
backgroundColor: mode === "BOTH" ? neutral33 : neutral11, | ||
padding: layout.spacing_x0_5, | ||
borderRadius: 6, | ||
borderWidth: 1, | ||
borderColor: hoveredButton === "BOTH" ? neutralFF : neutral11, | ||
}} | ||
onHoverIn={() => setHoveredButton("BOTH")} | ||
onHoverOut={() => setHoveredButton(null)} | ||
> | ||
<SVG | ||
source={splittedSquareSVG} | ||
height={24} | ||
width={24} | ||
color={neutralFF} | ||
/> | ||
</CustomPressable> | ||
<SpacerRow size={1} /> | ||
<CustomPressable | ||
onPress={() => setMode("PREVIEW")} | ||
style={{ | ||
backgroundColor: mode === "PREVIEW" ? neutral33 : neutral11, | ||
padding: layout.spacing_x0_5, | ||
borderRadius: 6, | ||
borderWidth: 1, | ||
borderColor: hoveredButton === "PREVIEW" ? neutralFF : neutral11, | ||
}} | ||
onHoverIn={() => setHoveredButton("PREVIEW")} | ||
onHoverOut={() => setHoveredButton(null)} | ||
> | ||
<SVG source={eyeSVG} height={24} width={24} color={neutralFF} /> | ||
</CustomPressable> | ||
</> | ||
); | ||
}; |
56 changes: 11 additions & 45 deletions
56
packages/screens/FeedNewArticle/components/ArticleContentEditor/Toolbar/Toolbar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,27 @@ | ||
import { Dispatch, FC, SetStateAction } from "react"; | ||
import { View } from "react-native"; | ||
|
||
import { BrandText } from "@/components/BrandText"; | ||
import { CustomPressable } from "@/components/buttons/CustomPressable"; | ||
import { SpacerRow } from "@/components/spacer"; | ||
import { TertiaryBox } from "@/components/boxes/TertiaryBox"; | ||
import { ModeButtons } from "@/screens/FeedNewArticle/components/ArticleContentEditor/Toolbar/ModeButtons"; | ||
import { ContentMode } from "@/utils/feed/markdown"; | ||
import { neutral1A } from "@/utils/style/colors"; | ||
import { fontSemibold12 } from "@/utils/style/fonts"; | ||
import { neutral11 } from "@/utils/style/colors"; | ||
import { layout } from "@/utils/style/layout"; | ||
|
||
interface Props { | ||
setMode: Dispatch<SetStateAction<ContentMode>>; | ||
mode: ContentMode; | ||
} | ||
|
||
export const Toolbar: FC<Props> = ({ setMode }) => { | ||
export const Toolbar: FC<Props> = ({ setMode, mode }) => { | ||
return ( | ||
<View | ||
<TertiaryBox | ||
style={{ | ||
flexDirection: "row", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
alignSelf: "center", | ||
padding: layout.spacing_x1, | ||
backgroundColor: neutral11, | ||
}} | ||
> | ||
<View style={{ flexDirection: "row", alignSelf: "center" }}> | ||
<CustomPressable | ||
onPress={() => setMode("EDITION")} | ||
style={{ | ||
backgroundColor: neutral1A, | ||
padding: layout.spacing_x1, | ||
borderRadius: 8, | ||
}} | ||
> | ||
<BrandText style={fontSemibold12}>Edition</BrandText> | ||
</CustomPressable> | ||
<SpacerRow size={1} /> | ||
<CustomPressable | ||
onPress={() => setMode("BOTH")} | ||
style={{ | ||
backgroundColor: neutral1A, | ||
padding: layout.spacing_x1, | ||
borderRadius: 8, | ||
}} | ||
> | ||
<BrandText style={fontSemibold12}>Edition | Preview</BrandText> | ||
</CustomPressable> | ||
<SpacerRow size={1} /> | ||
<CustomPressable | ||
onPress={() => setMode("PREVIEW")} | ||
style={{ | ||
backgroundColor: neutral1A, | ||
padding: layout.spacing_x1, | ||
borderRadius: 8, | ||
}} | ||
> | ||
<BrandText style={fontSemibold12}>Preview</BrandText> | ||
</CustomPressable> | ||
</View> | ||
</View> | ||
<ModeButtons setMode={setMode} mode={mode} /> | ||
</TertiaryBox> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters