Skip to content

Commit 2da745f

Browse files
committed
fix: Feedback redesign
1 parent 7accda4 commit 2da745f

File tree

4 files changed

+43
-25
lines changed

4 files changed

+43
-25
lines changed

src/components/PageContent/Feedback.tsx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ export const Feedback = () => {
3636
return
3737
}
3838
setRating(selectedNumber + 1)
39+
setTimeout(() => {
40+
const scollElement = document.querySelector(".sidebar-nav-inner")
41+
scollElement.scrollTo({
42+
top: scollElement.scrollHeight,
43+
behavior: "smooth",
44+
})
45+
}, 0)
3946
setIsSent(false)
4047
const path = "https://hviedclg.api.lncldglobal.com/1.1/classes/Feedback"
4148
const data = {
@@ -91,6 +98,7 @@ export const Feedback = () => {
9198
style={{
9299
cursor: "pointer",
93100
marginRight: "10px",
101+
fontSize: 0,
94102
}}
95103
>
96104
{rating >= i + 1 ? star : starOutline}
@@ -99,41 +107,44 @@ export const Feedback = () => {
99107
</div>
100108
{!!rating && (
101109
<section
102-
className="card"
103110
style={{
104-
marginTop: "30px",
111+
marginTop: "16px",
105112
}}
106113
>
107114
{isSent ? (
108-
<div style={{ color: "#FFF8F3", fontSize: "1rem", lineHeight: "normal" }}>
115+
<div className="text-dark dark:text-white" style={{ fontSize: "1rem", lineHeight: "normal" }}>
109116
We appreciate your feedback! 🤎
110117
</div>
111118
) : (
112119
<form
120+
className="feedback-form"
113121
onSubmit={handleSubmit}
114-
style={{ display: "flex", flexDirection: "column", gap: "0.3rem", marginBottom: "6px" }}
122+
style={{ display: "flex", flexDirection: "column" }}
115123
>
116124
<label
117125
htmlFor="name"
118-
style={{ color: "#FFF8F3", fontSize: "1rem", lineHeight: "normal", marginBottom: "20px" }}
126+
className="text-dark dark:text-white"
127+
style={{ fontSize: "1rem", lineHeight: "normal", marginBottom: "16px" }}
119128
>
120129
Tell us more about your experience.
121130
</label>
122-
<div style={{ borderRadius: "10px", overflow: "hidden", display: "flex", flexDirection: "column" }}>
131+
<div style={{ display: "flex", flexDirection: "column" }}>
123132
<textarea
124133
name="msg"
125134
rows="4"
135+
className="text-black dark:text-white border-black dark:border-white bg-pure-white dark:bg-black"
126136
style={{
127-
borderWidth: " 0",
128137
padding: "15px",
129138
caretColor: "#C4C4C4",
130139
outline: "none",
131140
fontSize: "1rem",
141+
borderRadius: "10px",
142+
marginBottom: "16px",
132143
}}
133144
/>
134145
<button
135146
className={button.primary}
136-
style={{ borderRadius: 0, borderWidth: " 0", background: "var(--orange-400)" }}
147+
style={{ borderRadius: "5px", borderWidth: " 0", background: "var(--orange-400)" }}
137148
disabled={isSubmitting}
138149
>
139150
submit

src/components/RightSidebar/RightSidebar.astro

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const { content, githubEditUrl, headings, clientSideToc } = Astro.props
1616
</div>
1717

1818
<div>
19-
<h2 class="heading feedback-title">{t("rightSidebar.feedback")}</h2>
19+
<h2 class="heading">{t("rightSidebar.feedback")}</h2>
2020
<div class="feedback-wrapper">
2121
<Feedback client:idle />
2222
</div>
@@ -37,8 +37,8 @@ const { content, githubEditUrl, headings, clientSideToc } = Astro.props
3737
@apply !mb-6;
3838
}
3939
.sidebar-nav-inner {
40-
padding: 16px 20px 70px 4px;
41-
overflow: auto;
40+
padding: 24px 20px 24px 4px;
41+
overflow-y: scroll;
4242
background: #fff8f3;
4343
border-radius: 1em;
4444
float: right;
@@ -48,13 +48,9 @@ const { content, githubEditUrl, headings, clientSideToc } = Astro.props
4848
@apply bg-white dark:bg-dark-normal;
4949
}
5050
.sidebar-nav-inner > * {
51-
margin-top: 1rem;
51+
margin-top: 32px;
5252
}
5353
.sidebar-nav-inner > *:first-child {
5454
margin-top: 0;
5555
}
56-
57-
.sidebar-nav-inner h2 {
58-
@apply m-0 mt-4;
59-
}
6056
</style>

src/styles/index.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ article > section nav {
100100

101101
article > section ::marker {
102102
font-weight: bold;
103-
@apply text-light;
103+
@apply text-marker;
104+
}
105+
.dark article > section ::marker {
106+
@apply text-dark-marker;
104107
}
105108

106109
article > section iframe {
@@ -171,15 +174,12 @@ strong {
171174
margin: 0.125em;
172175
border-radius: var(--border-radius);
173176
word-break: break-word;
174-
background: var(--gray-200);
175-
color: var(--black-100);
176-
@apply font-mono;
177+
@apply font-mono text-code bg-code dark:text-dark-code dark:bg-dark-code;
177178
}
178179

179180
a > code {
180181
position: relative;
181-
color: #ff684b;
182-
background: #ffe7e2;
182+
@apply text-link-code dark:text-link-code bg-link-code dark:bg-link-dark-code;
183183
}
184184

185185
pre.astro-code > code {
@@ -293,7 +293,7 @@ h2.heading {
293293
font-weight: 700 !important;
294294
padding: 0.1rem 0rem;
295295
/* margin-top: 30px; */
296-
margin-bottom: 20px;
296+
margin-bottom: 16px;
297297
font-family: var(--font-family-body-text);
298298
}
299299

tailwind.config.cjs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ module.exports = {
2828
highlight: "#FFDEB5",
2929
"dark-highlight": "#3b3b3b",
3030
"callout-note": "#FFF8F3",
31-
"callout-dark-note": "#262626",
31+
"callout-dark-note": "#2E261C",
3232
"callout-caution": "#F8F5E0",
3333
"callout-dark-caution": "#5D4C38",
3434
"callout-danger": "#FFE4DF",
3535
"callout-dark-danger": "#662A1E",
3636
"callout-tip": "#EEEEEE",
37-
"callout-dark-tip": "#3A635E",
37+
"callout-dark-tip": "#3B3B3B",
38+
"link-code": "#ffe7e2",
39+
"link-dark-code": "#33150F",
40+
code: "#dadada",
41+
"dark-code": "#5B5B5B",
3842
},
3943
borderColor: {
4044
primary: "#dadada",
@@ -185,6 +189,13 @@ module.exports = {
185189
fontSize: {
186190
base: ["16px", "28px"],
187191
},
192+
textColor: {
193+
"link-code": "#ff684b",
194+
code: "#101010",
195+
"dark-code": "#fff",
196+
marker: "#586474",
197+
"dark-marker": "#FFF8F3",
198+
},
188199
height: {
189200
navbar: "var(--theme-navbar-height)",
190201
},

0 commit comments

Comments
 (0)