Skip to content

Commit 7c49df0

Browse files
committed
style(App.css): adjust max-width of .app class to 500px for better layout
style(App.css): increase margin-bottom and font-size of h1 for improved readability feat(UpdatePet.tsx): add update-pet class for styling the update pet form feat(PetDetail.tsx): add refetch button to allow users to refresh pet data style(index.css): center body content and add padding for better visual appeal
1 parent fcf4058 commit 7c49df0

File tree

4 files changed

+49
-4
lines changed

4 files changed

+49
-4
lines changed

examples/hooks/src/App.css

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.app {
2-
max-width: 800px;
2+
max-width: 500px;
33
margin: 0 auto;
44
padding: 2rem;
55
font-family: system-ui, -apple-system, sans-serif;
@@ -8,7 +8,8 @@
88
.app h1 {
99
color: #2563eb;
1010
text-align: center;
11-
margin-bottom: 0.5rem;
11+
margin-bottom: 1rem;
12+
font-size: 2rem;
1213
}
1314

1415
.app > p {
@@ -85,6 +86,41 @@
8586
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
8687
}
8788

89+
.update-pet {
90+
background: white;
91+
border: 1px solid #e2e8f0;
92+
border-radius: 12px;
93+
padding: 2rem;
94+
margin-bottom: 2rem;
95+
color: black;
96+
}
97+
98+
.update-pet label {
99+
display: block;
100+
margin: 0.5rem 0;
101+
font-weight: 500;
102+
color: #374151;
103+
}
104+
105+
.update-pet input {
106+
box-sizing: border-box;
107+
padding: 0.5rem;
108+
border: 1px solid #d1d5db;
109+
border-radius: 4px;
110+
width: 100%;
111+
}
112+
113+
.update-pet select {
114+
padding: 0.5rem;
115+
border: 1px solid #d1d5db;
116+
border-radius: 4px;
117+
width: 100%;
118+
}
119+
120+
.update-pet button {
121+
margin-top: 1rem;
122+
}
123+
88124
.pet-card h2 {
89125
margin: 0 0 1rem 0;
90126
color: #1f2937;

examples/hooks/src/components/PetDetail.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const PetDetail = ({
1313
data: pet,
1414
isPending,
1515
isRefetching,
16+
refetch,
1617
error,
1718
} = hooks.useGetPetById({
1819
params,
@@ -76,6 +77,9 @@ export const PetDetail = ({
7677
</div>
7778
)}
7879
</div>
80+
<button type="button" onClick={() => refetch()}>
81+
Refetch
82+
</button>
7983
</div>
8084
)
8185
);

examples/hooks/src/components/UpdatePet.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export const UpdatePetForm = ({
5050
};
5151

5252
return (
53+
<div className="update-pet">
54+
55+
5356
<form onSubmit={handleSubmit}>
5457
<div>
5558
<label htmlFor="name">Pet Name:</label>
@@ -98,6 +101,7 @@ export const UpdatePetForm = ({
98101
</div>
99102
)}
100103
</form>
104+
</div>
101105
);
102106
};
103107

examples/hooks/src/index.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ a:hover {
2424

2525
body {
2626
margin: 0;
27-
display: flex;
27+
align-items: center;
2828
min-width: 320px;
29-
min-height: 100vh;
29+
margin: 2rem auto;
30+
padding: 2rem;
3031
}
3132

3233
h1 {

0 commit comments

Comments
 (0)