Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Placeholder from 'utopia-api' #20

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/routes/_index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { RecommendedProducts } from '../components/RecommendedProducts'
import { loader as loaderTemplate } from './trippy-trails-template'
import { connectToMetaObjects as connectToMetaObjectsTemplate } from '../helpers/connect-metaobject'
import { Image, Money } from '@shopify/hydrogen'
import { Placeholder } from 'utopia-api'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not being used here at all


export const loader = loaderTemplate

Expand Down
39 changes: 25 additions & 14 deletions utopia/components.utopia.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
DuplicatedImageWithBackground,
Grid,
HalfAndHalf,
Placeholder,
QuoteWithRating,
Row,
Section,
Expand Down Expand Up @@ -37,14 +36,15 @@ import { TestimonialCard } from '../app/routes/_index'

const PlaceholderContent = {
component: 'Placeholder',
moduleName: '/app/components/Components',
moduleName: 'utopia-api',
variants: [],
}

const RowWithPlaceholdersVariant = {
label: 'Row with Placeholders',
imports:
'import { Row, Placeholder } from "/app/components/Components"',
`import { Row } from "/app/components/Components"
import { Placeholder } from "utopia-api"`,
code: `<Row style={{ gap: 10 }} padded >
<Placeholder />
<Placeholder />
Expand All @@ -65,7 +65,8 @@ const SectionVariants = [
{
label: 'Section with Placeholder',
imports:
'import { Section, Placeholder } from "/app/components/Components"',
`import { Section } from "/app/components/Components"
import { Placeholder } from "utopia-api"`,
code: `<Section padded minHeight>
<Placeholder />
</Section>`,
Expand All @@ -79,7 +80,8 @@ const SectionVariants = [
{
label: 'Section with Row',
imports:
'import { Section, Row, Placeholder } from "/app/components/Components"',
`import { Section, Row } from "/app/components/Components"
import { Placeholder } from "utopia-api"`,
code: `<Section padded minHeight>
<Row>
<Placeholder />
Expand All @@ -90,7 +92,8 @@ const SectionVariants = [
{
label: 'Section with Column',
imports:
'import { Section, Placeholder, Column } from "/app/components/Components"',
`import { Section, Column } from "/app/components/Components"
import { Placeholder } from "utopia-api"`,
code: `<Section padded minHeight>
<Placeholder />
</Section>`,
Expand All @@ -99,7 +102,8 @@ const SectionVariants = [
label: 'Hero Section',
imports: `
import { Money } from "@shopify/hydrogen"
import { Section, DecorativeClouds, ColorOptionsColumn, Placeholder, Column, Row, HalfAndHalf, TypographyTitle, TrippyButton, Spacer } from "/app/components/Components"
import { Section, DecorativeClouds, ColorOptionsColumn, Column, Row, HalfAndHalf, TypographyTitle, TrippyButton, Spacer } from "/app/components/Components"
import { Placeholder } from "utopia-api"
import { Illustration } from "/app/routes/_index"
`,
code: `<Section
Expand Down Expand Up @@ -178,7 +182,8 @@ const SectionVariants = [
{
label: 'Testimonial Section',
imports: `
import { Section, DecorativeClouds, ColorOptionsColumn, Placeholder, Column, Row, HalfAndHalf, TypographyTitle, TrippyButton, Spacer, TypographyParagraph } from "/app/components/Components"
import { Section, DecorativeClouds, ColorOptionsColumn, Column, Row, HalfAndHalf, TypographyTitle, TrippyButton, Spacer, TypographyParagraph } from "/app/components/Components"
import { Placeholder } from "utopia-api"
import { TestimonialCard } from "/app/routes/_index"
`,
code: `<Section
Expand Down Expand Up @@ -280,7 +285,8 @@ const SectionVariants = [
label: 'Featured Collections Section',
imports: `
import { Image } from '@shopify/hydrogen'
import { ProductFeatureRow, QuoteWithRating, TwoFeatureCallout, Section, DecorativeClouds, ColorOptionsColumn, Placeholder, Column, Row, HalfAndHalf, TypographyTitle, TrippyButton, Spacer } from "/app/components/Components"
import { ProductFeatureRow, QuoteWithRating, TwoFeatureCallout, Section, DecorativeClouds, ColorOptionsColumn, Column, Row, HalfAndHalf, TypographyTitle, TrippyButton, Spacer } from "/app/components/Components"
import { Placeholder } from "utopia-api"
`,
code: `
<Section style={{ padding: '5em 9em' }}>
Expand Down Expand Up @@ -423,7 +429,8 @@ const SectionVariants = [
const ColumnWithPlaceholdersVariant = {
label: 'Column with Placeholders',
imports:
"import { Column, Placeholder } from '/app/components/Components'",
`import { Column } from '/app/components/Components'
import { Placeholder } from 'utopia-api'`,
code: `<Column style={{ gap: 10 }} padded >
<Placeholder />
<Placeholder />
Expand Down Expand Up @@ -638,7 +645,7 @@ const Components = {
children: 'not-supported',
variants: {
label: 'QuoteWithRating',
imports: `import { QuoteWithRating, Placeholder } from "/app/components/Components"`,
imports: `import { QuoteWithRating } from "/app/components/Components"`,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placeholder isn't being used here at all

code: `<QuoteWithRating
quote={'I love this!'}
rating={5}
Expand Down Expand Up @@ -667,7 +674,9 @@ const Components = {
children: 'not-supported',
variants: {
label: 'TwoFeatureCallout',
imports: `import { TwoFeatureCallout, Placeholder } from "/app/components/Components"`,
imports: `
import { TwoFeatureCallout } from "/app/components/Components"
import { Placeholder } from "utopia-api"`,
code: `<TwoFeatureCallout
style={{ gap: 10 }}
left={<Placeholder />}
Expand Down Expand Up @@ -821,7 +830,9 @@ const Components = {
children: 'not-supported',
variants: {
label: 'HalfAndHalf',
imports: `import { HalfAndHalf, Placeholder } from "/app/components/Components"`,
imports: `
import { HalfAndHalf } from "/app/components/Components"
import { Placeholder } from "utopia-api"`,
code: `<HalfAndHalf
style={{ gap: 10 }}
left={<Placeholder />}
Expand Down Expand Up @@ -874,7 +885,7 @@ const Components = {
],
},
Placeholder: {
component: Placeholder,
component: Utopia.Placeholder,
icon: 'dashedframe',
properties: {
margin: Utopia.numberControl(),
Expand Down