Extract common errorBanner style to shared styles
- Added errorBanner to sharedStyles for consistent error display - Removed duplicate errorBanner definitions from all pages - Updated appointments, booking, admin/appointments, and admin/availability pages - Reduced code duplication while maintaining component-specific styles
This commit is contained in:
parent
3d83472b97
commit
b9f605d7b3
5 changed files with 40 additions and 43 deletions
|
|
@ -9,6 +9,7 @@ import { useRequireAuth } from "../hooks/useRequireAuth";
|
|||
import { components } from "../generated/api";
|
||||
import constants from "../../../shared/constants.json";
|
||||
import { formatDate, formatTime, getDateRange } from "../utils/date";
|
||||
import { sharedStyles } from "../styles/shared";
|
||||
|
||||
const { slotDurationMinutes, maxAdvanceDays, minAdvanceDays, noteMaxLength } = constants.booking;
|
||||
|
||||
|
|
@ -16,7 +17,7 @@ type BookableSlot = components["schemas"]["BookableSlot"];
|
|||
type AvailableSlotsResponse = components["schemas"]["AvailableSlotsResponse"];
|
||||
type AppointmentResponse = components["schemas"]["AppointmentResponse"];
|
||||
|
||||
const styles: Record<string, React.CSSProperties> = {
|
||||
const pageStyles: Record<string, React.CSSProperties> = {
|
||||
main: {
|
||||
minHeight: "100vh",
|
||||
background: "linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #2d1b4e 100%)",
|
||||
|
|
@ -61,16 +62,6 @@ const styles: Record<string, React.CSSProperties> = {
|
|||
fontFamily: "'DM Sans', system-ui, sans-serif",
|
||||
fontSize: "0.875rem",
|
||||
},
|
||||
errorBanner: {
|
||||
background: "rgba(239, 68, 68, 0.15)",
|
||||
border: "1px solid rgba(239, 68, 68, 0.3)",
|
||||
color: "#f87171",
|
||||
padding: "1rem",
|
||||
borderRadius: "8px",
|
||||
marginBottom: "1rem",
|
||||
fontFamily: "'DM Sans', system-ui, sans-serif",
|
||||
fontSize: "0.875rem",
|
||||
},
|
||||
section: {
|
||||
marginBottom: "2rem",
|
||||
},
|
||||
|
|
@ -217,6 +208,8 @@ const styles: Record<string, React.CSSProperties> = {
|
|||
},
|
||||
};
|
||||
|
||||
const styles = { ...sharedStyles, ...pageStyles };
|
||||
|
||||
export default function BookingPage() {
|
||||
const { user, isLoading, isAuthorized } = useRequireAuth({
|
||||
requiredPermission: Permission.BOOK_APPOINTMENT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue