diff --git a/sites/org/components/search.mjs b/sites/org/components/search.mjs index 81af61e5b7c..35b540d7be7 100644 --- a/sites/org/components/search.mjs +++ b/sites/org/components/search.mjs @@ -10,9 +10,9 @@ import { connectHighlight, connectSearchBox, } from 'react-instantsearch-dom' -import { freeSewingConfig } from 'site/freesewing.config.mjs' +import { siteConfig } from 'site/site.config.mjs' -const searchClient = algoliasearch(freeSewingConfig.algolia.app, freeSewingConfig.algolia.key) +const searchClient = algoliasearch(siteConfig.algolia.app, siteConfig.algolia.key) const Hits = (props) => { // When we hit enter in the text field, we want to navigate to the result @@ -206,7 +206,7 @@ export const Search = (props) => { } return ( - + ) diff --git a/sites/org/hooks/use-navigation.mjs b/sites/org/hooks/use-navigation.mjs index fe634b9f619..3c94a73c689 100644 --- a/sites/org/hooks/use-navigation.mjs +++ b/sites/org/hooks/use-navigation.mjs @@ -4,7 +4,7 @@ import get from 'lodash.get' import { prebuildNavigation as pbn } from 'site/prebuild/navigation.mjs' import { useTranslation } from 'next-i18next' import orderBy from 'lodash.orderby' -import { freeSewingConfig as conf } from 'site/freesewing.config.mjs' +import { freeSewingConfig as conf } from 'shared/config/freesewing.config.mjs' import { useAccount } from 'shared/hooks/use-account.mjs' /* diff --git a/sites/org/pages/_app.mjs b/sites/org/pages/_app.mjs index a05544cadda..3c508238cbc 100644 --- a/sites/org/pages/_app.mjs +++ b/sites/org/pages/_app.mjs @@ -3,12 +3,12 @@ import { appWithTranslation } from 'next-i18next' import React from 'react' import Bugsnag from '@bugsnag/js' import BugsnagPluginReact from '@bugsnag/plugin-react' -import { freeSewingConfig } from 'site/freesewing.config.mjs' +import { siteConfig } from 'site/site.config.mjs' import { Toaster as DefaultToaster } from 'react-hot-toast' import { ContextWrapper } from 'shared/components/wrappers/context.mjs' Bugsnag.start({ - apiKey: freeSewingConfig.bugsnag.key, + apiKey: siteConfig.bugsnag.key, collectUserIp: false, plugins: [new BugsnagPluginReact()], }) diff --git a/sites/org/pages/typography.mjs b/sites/org/pages/typography.mjs index af4cdb366b6..2b4d0b7d13d 100644 --- a/sites/org/pages/typography.mjs +++ b/sites/org/pages/typography.mjs @@ -3,6 +3,7 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations' // Components import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs' import { Popout } from 'shared/components/popout.mjs' +import { Collapse } from 'shared/components/collapse.mjs' // Translation namespaces used on this page const namespaces = [...new Set(pageNs)] @@ -17,6 +18,30 @@ const p = ( const TypographyPage = ({ page }) => ( + + test + + + test + + + test + + + test + + + test + + + test + + + test + + + test +

This typography page shows an overview of different elements and how they are styled.

It's a good starting point for theme development.

diff --git a/sites/org/site.config.mjs b/sites/org/site.config.mjs new file mode 100644 index 00000000000..ebe2dd83253 --- /dev/null +++ b/sites/org/site.config.mjs @@ -0,0 +1,11 @@ +export const siteConfig = { + algolia: { + app: 'MA0Y5A2PF0', // Application ID + index: 'canary_freesewing.dev', + key: '589c7a7e4d9c95a4f12868581259bf3a', // Search-only API key + }, + bugsnag: { + key: '1b3a900d6ebbfd071975e39b534e1ff5', + }, + languages: ['en', 'es', 'de', 'fr', 'nl'], +} diff --git a/sites/shared/components/account/language.mjs b/sites/shared/components/account/language.mjs index a72ca4fe4e5..441c5f1da3e 100644 --- a/sites/shared/components/account/language.mjs +++ b/sites/shared/components/account/language.mjs @@ -10,7 +10,7 @@ import { LoadingContext } from 'shared/context/loading-context.mjs' // Components import { BackToAccountButton, Choice } from './shared.mjs' // Config -import { freeSewingConfig as conf } from 'site/freesewing.config.mjs' +import { siteConfig as conf } from 'site/freesewing.config.mjs' export const ns = ['account', 'locales', 'toast'] diff --git a/sites/shared/components/account/links.mjs b/sites/shared/components/account/links.mjs index d2ea0b21da3..3ff3fd63380 100644 --- a/sites/shared/components/account/links.mjs +++ b/sites/shared/components/account/links.mjs @@ -2,7 +2,7 @@ import { useAccount } from 'shared/hooks/use-account.mjs' import { useTranslation } from 'next-i18next' import Link from 'next/link' import { PageLink } from 'shared/components/page-link.mjs' -import { freeSewingConfig as conf } from 'site/freesewing.config.mjs' +import { freeSewingConfig as conf } from 'shared/config/freesewing.config.mjs' export const ns = ['account'] diff --git a/sites/shared/components/account/sets.mjs b/sites/shared/components/account/sets.mjs index 60d827beccc..72d3d9a3ec8 100644 --- a/sites/shared/components/account/sets.mjs +++ b/sites/shared/components/account/sets.mjs @@ -7,6 +7,7 @@ import orderBy from 'lodash.orderby' import { measurements, isDegreeMeasurement } from 'config/measurements.mjs' import { measurementAsMm, formatMm } from 'shared/utils.mjs' import { measurements as designMeasurements } from 'site/prebuild/design-measurements.mjs' +import { freeSewingConfig as conf } from 'shared/config/freesewing.config.mjs' // Hooks import { useDropzone } from 'react-dropzone' import { useAccount } from 'shared/hooks/use-account.mjs' @@ -641,49 +642,88 @@ const EditMeasurementsSet = (props) => { return (
-
-
- {t('permalink')}: - {mset.public ? ( - - ) : ( - - )} + {/* Meta info */} + {props.account.control > 2 ? ( +
+
+ {t('permalink')}: + {mset.public ? ( + + ) : ( + + )} +
+
+ {t('created')}: +
+
+ {t('updated')}: +
-
- {t('created')}: + ) : null} + + {/* JSON & YAML links */} + {props.account.control > 3 ? ( + -
- {t('updated')}: -
-
+ ) : null} + + {/* Name is always shown */} {mset.name} - - - - -
- {mset.public ? ( - <> - {t('publicSet')} - - ) : ( - <> - {t('privateSet')} - - )} -
-
- - {mset.imperial ? t('imperialUnits') : t('metricUnits')} - - - {mset.notes} - + + {/* img: Control level determines whether or not to show this */} + {props.account.control >= conf.account.sets.img ? ( + + + + ) : null} + + {/* public: Control level determines whether or not to show this */} + {props.account.control >= conf.account.sets.public ? ( + +
+ {mset.public ? ( + <> + {t('publicSet')} + + ) : ( + <> + {t('privateSet')} + + )} +
+
+ ) : null} + + {/* units: Control level determines whether or not to show this */} + {props.account.control >= conf.account.sets.units ? ( + + {mset.imperial ? t('imperialUnits') : t('metricUnits')} + + ) : null} + + {/* notes: Control level determines whether or not to show this */} + {props.account.control >= conf.account.sets.notes ? ( + + {mset.notes} + + ) : null}
diff --git a/sites/org/freesewing.config.mjs b/sites/shared/config/freesewing.config.mjs similarity index 67% rename from sites/org/freesewing.config.mjs rename to sites/shared/config/freesewing.config.mjs index 2335ded6fa6..3d97eae8c00 100644 --- a/sites/org/freesewing.config.mjs +++ b/sites/shared/config/freesewing.config.mjs @@ -1,13 +1,6 @@ export const freeSewingConfig = { - algolia: { - app: 'MA0Y5A2PF0', // Application ID - index: 'canary_freesewing.dev', - key: '589c7a7e4d9c95a4f12868581259bf3a', // Search-only API key - }, - bugsnag: { - key: '1b3a900d6ebbfd071975e39b534e1ff5', - }, monorepo: 'https://github.com/freesewing/freesewing', + backend: process.env.NEXT_PUBLIC_BACKEND, maxWidth: 2800, account: { fields: { @@ -36,6 +29,12 @@ export const freeSewingConfig = { apikeys: 4, }, }, + sets: { + name: 1, + img: 2, + public: 3, + units: 2, + notes: 2, + }, }, - languages: ['en', 'es', 'de', 'fr', 'nl'], } diff --git a/sites/shared/config/freesewing.mjs b/sites/shared/config/freesewing.mjs deleted file mode 100644 index 5ed1f421f21..00000000000 --- a/sites/shared/config/freesewing.mjs +++ /dev/null @@ -1,58 +0,0 @@ -/* URL to strapi for blog, showcase, and newsletter posts */ -export const strapiHost = 'https://posts.freesewing.org' - -/* URL to FreeSewing's monorepo on Github */ -export const monorepo = 'https://github.com/freesewing/freesewing' - -/* Default theme */ -export const defaultTheme = 'light' - -/* A list of all measurements used by FreeSewing */ -export const measurements = [ - 'ankle', - 'biceps', - 'bustFront', - 'bustPointToUnderbust', - 'bustSpan', - 'chest', - 'crossSeam', - 'crossSeamFront', - 'crotchDepth', - 'heel', - 'head', - 'highBust', - 'highBustFront', - 'hips', - 'hpsToBust', - 'hpsToWaistBack', - 'hpsToWaistFront', - 'inseam', - 'knee', - 'neck', - 'seat', - 'seatBack', - 'shoulderSlope', - 'shoulderToElbow', - 'shoulderToShoulder', - 'shoulderToWrist', - 'underbust', - 'upperLeg', - 'waist', - 'waistBack', - 'waistToArmhole', - 'waistToFloor', - 'waistToHips', - 'waistToKnee', - 'waistToSeat', - 'waistToUnderbust', - 'waistToUpperLeg', - 'wrist', -] - -/* A list of measurments that are degrees (rather than mm) */ -export const degreeMeasurements = ['shoulderSlope'] - -/* Helper method to determine whether a measurement uses degrees */ -export const isDegreeMeasurement = (measie) => degreeMeasurements.indexOf(measie) !== -1 - - diff --git a/sites/shared/config/tailwind-force.html b/sites/shared/config/tailwind-force.html index 1a8761f445c..c6956faefb6 100644 --- a/sites/shared/config/tailwind-force.html +++ b/sites/shared/config/tailwind-force.html @@ -43,4 +43,13 @@
+ + + + + + + + +