Skip to content

Commit

Permalink
Use row to improve fields layout
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Nov 13, 2024
1 parent 053e206 commit d06ca27
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
5 changes: 5 additions & 0 deletions apps/climatemappedafrica/src/payload/fields/HURUmapURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ function HURUmapURL(props) {
"div",
{
id: "hurumap-url-wrapper",
style: {
display: "flex",
alignItems: "center",
gap: "10px",
},
},
createElement(TextInput, {
...props,
Expand Down
43 changes: 25 additions & 18 deletions apps/climatemappedafrica/src/payload/globals/HURUMap/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const Profile = {
Field: ProfileSelect,
},
condition: (_, siblingData) => !!siblingData?.urlValid,
width: "50%",
},
},
{
Expand All @@ -54,25 +55,30 @@ const Profile = {
},
fields: [
{
name: "code",
type: "text",
label: {
en: "Location Code",
},
required: true,
hasMany: false,
defaultValue: "af",
admin: {
components: {
Field: LocationSelect,
type: "row",
fields: [
{
name: "code",
type: "text",
label: {
en: "Location Code",
},
required: true,
hasMany: false,
defaultValue: "af",
admin: {
components: {
Field: LocationSelect,
},
},
},
},
},
{
name: "center",
label: "Center Point",
type: "point",
defaultValue: [20.0, 4.25],
{
name: "center",
label: "Center Point",
type: "point",
defaultValue: [20.0, 4.25],
},
],
},
{
name: "hasData",
Expand Down Expand Up @@ -100,6 +106,7 @@ const Profile = {
required: true,
admin: {
description: "The page to show the HURUmap profile on.",
width: "50%",
},
},
],
Expand Down

0 comments on commit d06ca27

Please sign in to comment.