feat: display salon rules as bullet points instead of dense paragraphs
Each rule's body text is split into sentences and rendered as a dash list, matching Mira's request for less dense, easier-to-scan rules.
This commit is contained in:
@@ -20,9 +20,28 @@
|
|||||||
margin: 0 0 0.35rem;
|
margin: 0 0 0.35rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section p {
|
.points {
|
||||||
color: var(--color-charcoal);
|
color: var(--color-charcoal);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.points li {
|
||||||
|
position: relative;
|
||||||
|
padding-left: 1rem;
|
||||||
|
margin-bottom: 0.35rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.points li:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.points li::before {
|
||||||
|
content: '\2013';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
color: var(--color-gold);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cta {
|
.cta {
|
||||||
|
|||||||
@@ -5,6 +5,13 @@ import RuleIcon from '../components/RuleIcon'
|
|||||||
import { fetchRules, type RuleSection } from '../data/rules'
|
import { fetchRules, type RuleSection } from '../data/rules'
|
||||||
import styles from './Rules.module.css'
|
import styles from './Rules.module.css'
|
||||||
|
|
||||||
|
function splitIntoPoints(body: string): string[] {
|
||||||
|
return body
|
||||||
|
.split(/(?<=[.!?])\s+/)
|
||||||
|
.map((sentence) => sentence.trim())
|
||||||
|
.filter(Boolean)
|
||||||
|
}
|
||||||
|
|
||||||
function Rules() {
|
function Rules() {
|
||||||
const [rules, setRules] = useState<RuleSection[]>([])
|
const [rules, setRules] = useState<RuleSection[]>([])
|
||||||
const [error, setError] = useState('')
|
const [error, setError] = useState('')
|
||||||
@@ -31,7 +38,11 @@ function Rules() {
|
|||||||
<RuleIcon iconKey={rule.iconKey} />
|
<RuleIcon iconKey={rule.iconKey} />
|
||||||
<div>
|
<div>
|
||||||
<h2>{rule.title}</h2>
|
<h2>{rule.title}</h2>
|
||||||
<p>{rule.body}</p>
|
<ul className={styles.points}>
|
||||||
|
{splitIntoPoints(rule.body).map((point, pointIndex) => (
|
||||||
|
<li key={pointIndex}>{point}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ScrollReveal>
|
</ScrollReveal>
|
||||||
|
|||||||
Reference in New Issue
Block a user