Skip to content

Commit

Permalink
refactor: Use CardWithSideImage component from front-core
Browse files Browse the repository at this point in the history
  • Loading branch information
gmolki committed Jun 14, 2024
1 parent f3aeb24 commit 5f7d62a
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 64 deletions.
70 changes: 68 additions & 2 deletions src/components/CardWithSideImage/cmp.builder.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,49 @@
import { Builder, withChildren } from "@builder.io/react";
import { DEFAULT_PROPS } from "@/constants/builderProps";
import CardWithSideImage from ".";
import { BACKGROUND_COLORS } from "@/constants/builderEnums";
import {
ALIGN_ITEMS_VALUES,
BACKGROUND_COLORS,
JUSTIFY_CONTENT_VALUES,
} from "@/constants/builderEnums";
import { CardWithSideImage } from "@aleph-front/core";
type AlignProps =
| "normal"
| "stretch"
| "center"
| "start"
| "end"
| "flex-start"
| "flex-end"
| "baseline"
| "first baseline"
| "last baseline"
| "safe center"
| "unsafe center"
| "inherit"
| "initial"
| "revert"
| "revert-layer"
| "unset";
type JustifyProps =
| "normal"
| "center"
| "start"
| "end"
| "flex-start"
| "flex-end"
| "left"
| "right"
| "space-between"
| "space-around"
| "space-evenly"
| "stretch"
| "safe center"
| "unsafe center"
| "inherit"
| "initial"
| "revert"
| "revert-layer"
| "unset";

Builder.registerComponent(withChildren(CardWithSideImage), {
...DEFAULT_PROPS,
Expand Down Expand Up @@ -29,6 +71,30 @@ Builder.registerComponent(withChildren(CardWithSideImage), {
enum: ["left", "right"],
defaultValue: "left",
},
{
name: "alignCard",
type: "string",
enum: ALIGN_ITEMS_VALUES,
defaultValue: "center",
},
{
name: "justifyCard",
type: "string",
enum: JUSTIFY_CONTENT_VALUES,
defaultValue: "center",
},
{
name: "alignImage",
type: "string",
enum: ALIGN_ITEMS_VALUES,
defaultValue: "center",
},
{
name: "justifyImage",
type: "string",
enum: JUSTIFY_CONTENT_VALUES,
defaultValue: "center",
},
{
name: "cardBackgroundColor",
type: "string",
Expand Down
54 changes: 0 additions & 54 deletions src/components/CardWithSideImage/cmp.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions src/components/CardWithSideImage/types.ts

This file was deleted.

42 changes: 42 additions & 0 deletions src/constants/builderEnums.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,45 @@ export const ONE_TO_TWELVE = [
"11",
"12",
];

export const JUSTIFY_CONTENT_VALUES = [
"normal",
"center",
"start",
"end",
"flex-start",
"flex-end",
"left",
"right",
"space-between",
"space-around",
"space-evenly",
"stretch",
"safe center",
"unsafe center",
"inherit",
"initial",
"revert",
"revert-layer",
"unset",
];

export const ALIGN_ITEMS_VALUES = [
"normal",
"stretch",
"center",
"start",
"end",
"flex-start",
"flex-end",
"baseline",
"first baseline",
"last baseline",
"safe center",
"unsafe center",
"inherit",
"initial",
"revert",
"revert-layer",
"unset",
];

0 comments on commit 5f7d62a

Please sign in to comment.