Skip to content

Commit

Permalink
feat: bold and underline
Browse files Browse the repository at this point in the history
  • Loading branch information
nevo-david committed Dec 27, 2024
1 parent 1bfa6de commit 041b076
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 64 deletions.
25 changes: 24 additions & 1 deletion apps/frontend/src/components/launches/bold.text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,30 @@ export const BoldText: FC<{ editor: any; currentValue: string }> = ({
onClick={mark}
className="select-none cursor-pointer bg-customColor2 w-[40px] p-[5px] text-center rounded-tl-lg rounded-tr-lg"
>
B
<svg
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_31_12616)">
<path
d="M14.7686 12.24C15.4192 12.3787 15.9419 12.704 16.3366 13.216C16.7312 13.7173 16.9286 14.2933 16.9286 14.944C16.9286 15.8827 16.5979 16.6293 15.9366 17.184C15.2859 17.728 14.3739 18 13.2006 18H7.96856V6.768H13.0246C14.1659 6.768 15.0566 7.02933 15.6966 7.552C16.3472 8.07467 16.6726 8.784 16.6726 9.68C16.6726 10.3413 16.4966 10.8907 16.1446 11.328C15.8032 11.7653 15.3446 12.0693 14.7686 12.24ZM10.7046 11.312H12.4966C12.9446 11.312 13.2859 11.216 13.5206 11.024C13.7659 10.8213 13.8886 10.528 13.8886 10.144C13.8886 9.76 13.7659 9.46667 13.5206 9.264C13.2859 9.06133 12.9446 8.96 12.4966 8.96H10.7046V11.312ZM12.7206 15.792C13.1792 15.792 13.5312 15.6907 13.7766 15.488C14.0326 15.2747 14.1606 14.9707 14.1606 14.576C14.1606 14.1813 14.0272 13.872 13.7606 13.648C13.5046 13.424 13.1472 13.312 12.6886 13.312H10.7046V15.792H12.7206Z"
fill="currentColor"
/>
</g>
<defs>
<clipPath id="clip0_31_12616">
<rect
width="24"
height="24"
fill="white"
transform="translate(0.25)"
/>
</clipPath>
</defs>
</svg>
</div>
);
};
150 changes: 87 additions & 63 deletions apps/frontend/src/components/launches/u.text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,68 @@ import { FC, useCallback } from 'react';
import { Editor, Transforms } from 'slate';

const underlineMap = {
"a": "a̲",
"b": "b̲",
"c": "c̲",
"d": "d̲",
"e": "e̲",
"f": "f̲",
"g": "g̲",
"h": "h̲",
"i": "i̲",
"j": "j̲",
"k": "k̲",
"l": "l̲",
"m": "m̲",
"n": "n̲",
"o": "o̲",
"p": "p̲",
"q": "q̲",
"r": "r̲",
"s": "s̲",
"t": "t̲",
"u": "u̲",
"v": "v̲",
"w": "w̲",
"x": "x̲",
"y": "y̲",
"z": "z̲",
"A": "A̲",
"B": "B̲",
"C": "C̲",
"D": "D̲",
"E": "E̲",
"F": "F̲",
"G": "G̲",
"H": "H̲",
"I": "I̲",
"J": "J̲",
"K": "K̲",
"L": "L̲",
"M": "M̲",
"N": "N̲",
"O": "O̲",
"P": "P̲",
"Q": "Q̲",
"R": "R̲",
"S": "S̲",
"T": "T̲",
"U": "U̲",
"V": "V̲",
"W": "W̲",
"X": "X̲",
"Y": "Y̲",
"Z": "Z̲",
"1": "1̲",
"2": "2̲",
"3": "3̲",
"4": "4̲",
"5": "5̲",
"6": "6̲",
"7": "7̲",
"8": "8̲",
"9": "9̲",
"0": "0̲",
a: 'a̲',
b: 'b̲',
c: 'c̲',
d: 'd̲',
e: 'e̲',
f: 'f̲',
g: 'g̲',
h: 'h̲',
i: 'i̲',
j: 'j̲',
k: 'k̲',
l: 'l̲',
m: 'm̲',
n: 'n̲',
o: 'o̲',
p: 'p̲',
q: 'q̲',
r: 'r̲',
s: 's̲',
t: 't̲',
u: 'u̲',
v: 'v̲',
w: 'w̲',
x: 'x̲',
y: 'y̲',
z: 'z̲',
A: 'A̲',
B: 'B̲',
C: 'C̲',
D: 'D̲',
E: 'E̲',
F: 'F̲',
G: 'G̲',
H: 'H̲',
I: 'I̲',
J: 'J̲',
K: 'K̲',
L: 'L̲',
M: 'M̲',
N: 'N̲',
O: 'O̲',
P: 'P̲',
Q: 'Q̲',
R: 'R̲',
S: 'S̲',
T: 'T̲',
U: 'U̲',
V: 'V̲',
W: 'W̲',
X: 'X̲',
Y: 'Y̲',
Z: 'Z̲',
'1': '1̲',
'2': '2̲',
'3': '3̲',
'4': '4̲',
'5': '5̲',
'6': '6̲',
'7': '7̲',
'8': '8̲',
'9': '9̲',
'0': '0̲',
};
export const UText: FC<{ editor: any; currentValue: string }> = ({
editor,
Expand All @@ -87,7 +87,31 @@ export const UText: FC<{ editor: any; currentValue: string }> = ({
onClick={mark}
className="select-none cursor-pointer bg-customColor2 w-[40px] p-[5px] text-center rounded-tl-lg rounded-tr-lg"
>
U
<svg
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_31_12620)">
<path
d="M10.4119 6.47V12.77C10.4119 13.4 10.5669 13.885 10.8769 14.225C11.1869 14.565 11.6419 14.735 12.2419 14.735C12.8419 14.735 13.3019 14.565 13.6219 14.225C13.9419 13.885 14.1019 13.4 14.1019 12.77V6.47H16.6669V12.755C16.6669 13.695 16.4669 14.49 16.0669 15.14C15.6669 15.79 15.1269 16.28 14.4469 16.61C13.7769 16.94 13.0269 17.105 12.1969 17.105C11.3669 17.105 10.6219 16.945 9.96191 16.625C9.31191 16.295 8.79691 15.805 8.41691 15.155C8.03691 14.495 7.84691 13.695 7.84691 12.755V6.47H10.4119Z"
fill="currentColor"
/>
<path d="M6.96191 18.5H17.5369V19.25H6.96191V18.5Z" fill="currentColor" />
</g>
<defs>
<clipPath id="clip0_31_12620">
<rect
width="24"
height="24"
fill="white"
transform="translate(0.25)"
/>
</clipPath>
</defs>
</svg>
</div>
);
};

0 comments on commit 041b076

Please sign in to comment.