Skip to content

Commit

Permalink
Merge pull request #7 from concrete-utopia/fix/strip-comments
Browse files Browse the repository at this point in the history
remove comments
  • Loading branch information
bkrmendy authored May 3, 2024
2 parents 4940465 + 87c3437 commit 1fe9fa6
Show file tree
Hide file tree
Showing 25 changed files with 3 additions and 63 deletions.
3 changes: 0 additions & 3 deletions app/components/Cart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ function CartLineItem({layout, line}) {
to={lineItemUrl}
onClick={() => {
if (layout === 'aside') {
// close the drawer
window.location.href = lineItemUrl;
}
}}
Expand Down Expand Up @@ -280,7 +279,6 @@ function CartDiscounts({discountCodes}) {

return (
<div>
{/* Have existing discount, display it with a remove option */}
<dl hidden={!codes.length}>
<div>
<dt>Discount(s)</dt>
Expand All @@ -294,7 +292,6 @@ function CartDiscounts({discountCodes}) {
</div>
</dl>

{/* Show an input to apply a discount */}
<UpdateDiscountForm discountCodes={codes}>
<div>
<input type="text" name="discountCode" placeholder="Discount code" />
Expand Down
1 change: 0 additions & 1 deletion app/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function FooterMenu({ menu, primaryDomainUrl }) {
<nav className='footer-menu' role='navigation'>
{(menu || FALLBACK_FOOTER_MENU).items.map((item) => {
if (!item.url) return null
// if the url is internal, we strip the domain
const url =
item.url.includes('myshopify.com') ||
item.url.includes(publicStoreDomain) ||
Expand Down
1 change: 0 additions & 1 deletion app/components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export function HeaderMenu({menu, primaryDomainUrl, viewport}) {
]).map((item) => {
if (!item.url) return null;

// if the url is internal, we strip the domain
const url =
item.url.includes('myshopify.com') ||
item.url.includes(publicStoreDomain) ||
Expand Down
8 changes: 0 additions & 8 deletions app/components/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ export function Layout({
isLoggedIn={isLoggedIn}
/>
<main>{children}</main>
{/* TODO Fix Footer */}
{/* <Suspense>
<Await resolve={footer}>
{(footer) => (
<Footer menu={footer.menu} shop={header.shop} />
)}
</Await>
</Suspense> */}
</>
)
}
Expand Down
6 changes: 0 additions & 6 deletions app/components/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const NO_PREDICTIVE_SEARCH_RESULTS = [
export function SearchForm({searchTerm}) {
const inputRef = useRef(null);

// focus the input when cmd+k is pressed
useEffect(() => {
function handleKeyDown(event) {
if (event.key === 'k' && event.metaKey) {
Expand Down Expand Up @@ -212,8 +211,6 @@ export function PredictiveSearchForm({
);
}

// ensure the passed input has a type of search, because SearchResults
// will select the element based on the input
useEffect(() => {
inputRef?.current?.setAttribute('type', 'search');
}, []);
Expand Down Expand Up @@ -244,7 +241,6 @@ export function PredictiveSearchResults() {
if (!searchInputRef.current) return;
searchInputRef.current.blur();
searchInputRef.current.value = '';
// close the aside
window.location.href = event.currentTarget.href;
}

Expand All @@ -264,7 +260,6 @@ export function PredictiveSearchResults() {
/>
))}
</div>
{/* view all results /search?q=term */}
{searchTerm.current && (
<Link onClick={goToSearchResult} to={`/search?q=${searchTerm.current}`}>
<p>
Expand Down Expand Up @@ -371,7 +366,6 @@ function usePredictiveSearch() {
totalResults: 0,
};

// capture the search input element as a ref
useEffect(() => {
if (searchInputRef.current) return;
searchInputRef.current = document.querySelector('input[type="search"]');
Expand Down
6 changes: 0 additions & 6 deletions app/root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export async function loader({ context }) {

export default function App() {
const nonce = useNonce()
/** @type {LoaderReturnData} */
const data = useLoaderData()

return (
Expand All @@ -139,8 +138,6 @@ export default function App() {
content='width=device-width,initial-scale=1'
/>
<Meta />
{/* We need to either move the loading of CSS someplace else instead of links() */}
{/* or fix Links throwing an error when navigating to a 404 */}
<Links />
</head>
<body>
Expand Down Expand Up @@ -178,9 +175,6 @@ export function ErrorBoundary() {
content='width=device-width,initial-scale=1'
/>
<Meta />
{/* Removed links, because it throws an exception when the actual route doesn't exist */}
{/* See https://github.com/concrete-utopia/utopia/issues/5218 }
{/* <Links /> */}
</head>
<body>
<Layout {...rootData}>
Expand Down
8 changes: 1 addition & 7 deletions app/routes/$.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
* @param {LoaderFunctionArgs}
*/
export async function loader({request}) {
throw new Response(`${new URL(request.url).pathname} not found`, {
status: 404,
Expand All @@ -9,7 +6,4 @@ export async function loader({request}) {

export default function CatchAllPage() {
return null;
}

/** @typedef {import('@shopify/remix-oxygen').LoaderFunctionArgs} LoaderFunctionArgs */
/** @typedef {import('@shopify/remix-oxygen').SerializeFrom<typeof loader>} LoaderReturnData */
}
4 changes: 0 additions & 4 deletions app/routes/_index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export default function LandingPage() {
zIndex: -1,
position: 'absolute',
top: 0,
// right: -80,
transform: 'scale(.75)',
}}
src='decorative/[email protected]'
Expand Down Expand Up @@ -198,7 +197,6 @@ export default function LandingPage() {
>
Amazing Pal for the Little Ones
</h2>
{/* TODO replace with remix link */}
<a
style={{
marginTop: '1em',
Expand Down Expand Up @@ -288,7 +286,6 @@ export default function LandingPage() {
>
Perfect for your lappy
</h2>
{/* TODO replace with remix link */}
<a
style={{
marginTop: '1em',
Expand Down Expand Up @@ -375,7 +372,6 @@ export default function LandingPage() {
>
Travel Companion
</h2>
{/* TODO replace with remix link */}
<a
style={{
marginTop: '1em',
Expand Down
1 change: 0 additions & 1 deletion app/routes/account.addresses.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ function ExistingAddresses({addresses, defaultAddress}) {
*/
export function AddressForm({address, defaultAddress, children}) {
const {state, formMethod} = useNavigation();
/** @type {ActionReturnData} */
const action = useActionData();
const error = action?.error?.[address.id];
const isDefaultAddress = defaultAddress?.id === address.id;
Expand Down
1 change: 0 additions & 1 deletion app/routes/account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export async function loader({request, context}) {
}

export default function Acccount() {
/** @type {LoaderReturnData} */
const {customer, isPrivateRoute, isAccountHome} = useLoaderData();

if (!isPrivateRoute && !isAccountHome) {
Expand Down
2 changes: 0 additions & 2 deletions app/routes/account.orders.$id.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export async function loader({params, context}) {
}

export default function OrderRoute() {
/** @type {LoaderReturnData} */
const {order, lineItems, discountValue, discountPercentage} = useLoaderData();
return (
<div className="account-order">
Expand All @@ -74,7 +73,6 @@ export default function OrderRoute() {
</thead>
<tbody>
{lineItems.map((lineItem, lineItemIndex) => (
// eslint-disable-next-line react/no-array-index-key
<OrderLineRow key={lineItemIndex} lineItem={lineItem} />
))}
</tbody>
Expand Down
1 change: 0 additions & 1 deletion app/routes/account.orders._index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export async function loader({request, context}) {
}

export default function Orders() {
/** @type {LoaderReturnData} */
const {customer} = useLoaderData();
const {orders, numberOfOrders} = customer;
return (
Expand Down
2 changes: 1 addition & 1 deletion app/routes/account.profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export async function action({request, context}) {
export default function AccountProfile() {
const account = useOutletContext();
const {state} = useNavigation();
/** @type {ActionReturnData} */

const action = useActionData();
const customer = action?.customer ?? account?.customer;

Expand Down
2 changes: 0 additions & 2 deletions app/routes/account_.activate.$id.$activationToken.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export async function action({request, context, params}) {
}

export default function Activate() {
/** @type {ActionReturnData} */
const action = useActionData();
const error = action?.error ?? null;

Expand All @@ -104,7 +103,6 @@ export default function Activate() {
aria-label="Password"
minLength={8}
required
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
/>
<label htmlFor="passwordConfirm">Re-enter password</label>
Expand Down
2 changes: 0 additions & 2 deletions app/routes/account_.login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export async function action({request, context}) {
}

export default function Login() {
/** @type {ActionReturnData} */
const data = useActionData();
const error = data?.error || null;

Expand All @@ -86,7 +85,6 @@ export default function Login() {
required
placeholder="Email address"
aria-label="Email address"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
/>
<label htmlFor="password">Password</label>
Expand Down
2 changes: 0 additions & 2 deletions app/routes/account_.recover.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export async function action({request, context}) {
}

export default function Recover() {
/** @type {ActionReturnData} */
const action = useActionData();

return (
Expand Down Expand Up @@ -75,7 +74,6 @@ export default function Recover() {
<input
aria-label="Email address"
autoComplete="email"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
id="email"
name="email"
Expand Down
3 changes: 0 additions & 3 deletions app/routes/account_.register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export async function action({request, context}) {
throw new Error('Could not create customer');
}

// get an access token for the new customer
const {customerAccessTokenCreate} = await storefront.mutate(
REGISTER_LOGIN_MUTATION,
{
Expand Down Expand Up @@ -97,7 +96,6 @@ export async function action({request, context}) {
}

export default function Register() {
/** @type {ActionReturnData} */
const data = useActionData();
const error = data?.error || null;
return (
Expand All @@ -114,7 +112,6 @@ export default function Register() {
required
placeholder="Email address"
aria-label="Email address"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
/>
<label htmlFor="password">Password</label>
Expand Down
2 changes: 0 additions & 2 deletions app/routes/account_.reset.$id.$resetToken.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export async function action({request, context, params}) {
}

export default function Reset() {
/** @type {ActionReturnData} */
const action = useActionData();

return (
Expand All @@ -76,7 +75,6 @@ export default function Reset() {
<input
aria-label="Password"
autoComplete="current-password"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
id="password"
minLength={8}
Expand Down
1 change: 0 additions & 1 deletion app/routes/blogs.$blogHandle._index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const loader = async ({request, params, context: {storefront}}) => {
};

export default function Blog() {
/** @type {LoaderReturnData} */
const {blog} = useLoaderData();
const {articles} = blog;

Expand Down
1 change: 0 additions & 1 deletion app/routes/blogs._index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const loader = async ({request, context: {storefront}}) => {
};

export default function Blogs() {
/** @type {LoaderReturnData} */
const {blogs} = useLoaderData();

return (
Expand Down
1 change: 0 additions & 1 deletion app/routes/collections._index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export async function loader({context, request}) {
}

export default function Collections() {
/** @type {LoaderReturnData} */
const {collections} = useLoaderData();

return (
Expand Down
1 change: 0 additions & 1 deletion app/routes/policies.$handle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export async function loader({params, context}) {
}

export default function Policy() {
/** @type {LoaderReturnData} */
const {policy} = useLoaderData();

return (
Expand Down
1 change: 0 additions & 1 deletion app/routes/products.$handle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ function redirectToFirstVariant({ product, request }) {
}

export default function Product() {
/** @type {LoaderReturnData} */
const { product, variants } = useLoaderData()
const { selectedVariant } = product
return (
Expand Down
5 changes: 1 addition & 4 deletions utopia/components.utopia.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ const ColumnVariants = [
},
]

// SectionSubtitle,
// SectionTitle,

const Components = {
'/app/routes/_index': {
TestimonialCard: {
Expand Down Expand Up @@ -453,7 +450,7 @@ const Components = {
variants: ColumnVariants,
},
],
}, // row with placeholders, column with placeholders
},
variants: SectionVariants,
},
Row: {
Expand Down
1 change: 0 additions & 1 deletion utopia/hydrogen.utopia.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const CurrencyCodeControl = Utopia.popupListControl([
value: 'EUR',
label: 'Euro (EUR).',
},
// TODO: all currencies
])

const UnitPriceMeasurementMeasuredUnit =
Expand Down

0 comments on commit 1fe9fa6

Please sign in to comment.