Skip to content

Commit 53adbcb

Browse files
committed
fix: resolve hydration mismatches on pages with ReuseCard and DataserviceCard
1 parent b88467e commit 53adbcb

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

components/Pages/PageShow.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
v-if="'fullWidth' in blocsTypes[bloc.class]"
5656
v-model="(workingPage.blocs[index] as any)"
5757
:edit
58-
:main-color="mainColor"
58+
v-bind="bloc.class === 'LinksListBloc' ? { 'main-color': mainColor } : {}"
5959
/>
6060

6161
<!-- Other blocs use container layout -->
@@ -67,7 +67,7 @@
6767
:is="blocsTypes[bloc.class].component"
6868
v-model="(workingPage.blocs[index] as any)"
6969
:edit
70-
:main-color="mainColor"
70+
v-bind="bloc.class === 'LinksListBloc' ? { 'main-color': mainColor } : {}"
7171
/>
7272
</div>
7373

datagouv-components/src/components/DataserviceCard.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
v-if="dataservice.organization || dataservice.owner"
6767
class="text-gray-medium overflow-hidden flex items-center gap-1 mt-1 mb-0"
6868
>
69-
<p
69+
<div
7070
v-if="dataservice.organization"
7171
class="text-sm block overflow-hidden mb-0 relative z-[2]"
7272
>
@@ -81,13 +81,13 @@
8181
v-else
8282
:organization="dataservice.organization"
8383
/>
84-
</p>
85-
<p
84+
</div>
85+
<div
8686
v-else
8787
class="text-sm mb-0 truncate"
8888
>
8989
{{ ownerName }}
90-
</p>
90+
</div>
9191
<RiSubtractLine class="size-4 flex-none fill-gray-medium" />
9292
<!-- This comment is only here to fix this issue https://github.com/datagouv/cdata/issues/653, it could be empty… -->
9393
<p class="text-sm whitespace-nowrap mb-0">

datagouv-components/src/components/ReuseCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</AppLink>
1212
</h3>
1313
<div class="order-3 text-sm m-0 text-gray-medium">
14-
<p class="text-sm mb-0 flex items-center">
14+
<div class="text-sm mb-0 flex items-center">
1515
<span
1616
v-if="reuse.organization"
1717
class="relative block truncate break-all z-[2] flex-initial"
@@ -36,7 +36,7 @@
3636
>{{ ownerName }}</span>
3737
<RiSubtractLine class="size-4 flex-none fill-gray-medium" />
3838
<span class="block flex-none">{{ t('publié {date}', { date: formatRelativeIfRecentDate(reuse.created_at, { dateStyle: 'medium' }) }) }}</span>
39-
</p>
39+
</div>
4040
<ReuseDetails :reuse />
4141
</div>
4242
</div>

0 commit comments

Comments
 (0)