diff --git a/packages/marketplace/linaria.config.js b/packages/marketplace/linaria.config.js index e1e8b188ef..1aec47cf1e 100644 --- a/packages/marketplace/linaria.config.js +++ b/packages/marketplace/linaria.config.js @@ -4,5 +4,5 @@ module.exports = { evaluate: true, displayName: false, // converts camelCase classNames to kebab-case-for-friendly-css - classNameSlug: (_hash, title) => dashify(title), + classNameSlug: (hash, title) => `${hash}-${dashify(title)}`, } diff --git a/packages/marketplace/src/components/pages/app-detail/__styles__/app-permission-content.ts b/packages/marketplace/src/components/pages/app-detail/__styles__/app-permission-content.ts new file mode 100644 index 0000000000..6c4b2c199f --- /dev/null +++ b/packages/marketplace/src/components/pages/app-detail/__styles__/app-permission-content.ts @@ -0,0 +1,25 @@ +import { css } from 'linaria' + +export const permissionBlock = css` + margin-bottom: 15px; +` + +export const installButtonContainer = css` + display: flex; +` + +export const installButton = css` + margin: 0 1rem; + width: 100%; + &:last-child { + margin: 0 0 0 1rem; + } +` + +export const permissionList = css` + padding: 0 2rem 2rem 2rem; +` + +export const permissionListItem = css` + list-style-type: circle; +` diff --git a/packages/marketplace/src/components/pages/app-detail/__styles__/standalone-app-detail.ts b/packages/marketplace/src/components/pages/app-detail/__styles__/standalone-app-detail.ts new file mode 100644 index 0000000000..fbe132a5a9 --- /dev/null +++ b/packages/marketplace/src/components/pages/app-detail/__styles__/standalone-app-detail.ts @@ -0,0 +1,74 @@ +import { css } from 'linaria' +import * as colors from '@/core/__styles__/colors' +import { forMobileOnly, forTabletAndBelow } from '@/core/__styles__/screen-size' +import { forIeOnly } from '@/core/__styles__/browser' + +export const preview = css` + position: relative; + top: 2px; +` + +export const check = css` + position: relative; + top: 2px; + left: 2px; + color: ${colors.reapitGreen}; +` + +export const tag = css` + display: inline-block; + padding: 0.5rem 1rem; + background: ${colors.greyLight}; + margin: 0.5rem 0.5rem 0 0; +` + +export const container = css` + height: 100%; + margin-bottom: auto; + ${forMobileOnly} { + display: flex; + flex-direction: column-reverse; + } + ${forIeOnly} { + min-width: 1024px; + } +` + +export const containerHeader = css` + display: flex; + align-items: center; + flex-direction: column; +` + +export const appIconContainer = css` + width: 96px; + height: auto; + margin: 0 auto; +` + +export const headerContent = css` + display: flex; + flex-direction: column; + padding: 1rem; + align-items: center; + text-align: center; +` + +export const containerOuterHeader = css` + ${forTabletAndBelow} { + flex-direction: column; + } +` + +export const buttonGroup = css` + display: flex; + flex-direction: column; + + ${forMobileOnly} { + > button { + width: 50%; + } + + flex-direction: row; + } +` diff --git a/packages/marketplace/src/components/pages/app-detail/client/__tests__/__snapshots__/app-detail.test.tsx.snap b/packages/marketplace/src/components/pages/app-detail/client/__tests__/__snapshots__/app-detail.test.tsx.snap index cc411e529c..0416d4aafd 100644 --- a/packages/marketplace/src/components/pages/app-detail/client/__tests__/__snapshots__/app-detail.test.tsx.snap +++ b/packages/marketplace/src/components/pages/app-detail/client/__tests__/__snapshots__/app-detail.test.tsx.snap @@ -57,6 +57,7 @@ exports[`AppDetail should match a snapshot 1`] = ` >

-

-
+
+
Peter's Properties
-
+
Peter's Properties Verified by Reapit - +
diff --git a/packages/marketplace/src/components/pages/app-detail/common/__tests__/__snapshots__/ui-helpers.test.tsx.snap b/packages/marketplace/src/components/pages/app-detail/common/__tests__/__snapshots__/ui-helpers.test.tsx.snap index 63ca3cfe79..af95749625 100644 --- a/packages/marketplace/src/components/pages/app-detail/common/__tests__/__snapshots__/ui-helpers.test.tsx.snap +++ b/packages/marketplace/src/components/pages/app-detail/common/__tests__/__snapshots__/ui-helpers.test.tsx.snap @@ -27,7 +27,9 @@ exports[`Ui Sections should match snapshot for has image 1`] = exports[`Ui Sections should match snapshot for no images 1`] = `""`; exports[`Ui Sections should match snapshot 1`] = ` -
+
Test
`; diff --git a/packages/marketplace/src/components/pages/app-detail/common/__tests__/__snapshots__/ui-sections.test.tsx.snap b/packages/marketplace/src/components/pages/app-detail/common/__tests__/__snapshots__/ui-sections.test.tsx.snap index 9c77e3b904..455370b893 100644 --- a/packages/marketplace/src/components/pages/app-detail/common/__tests__/__snapshots__/ui-sections.test.tsx.snap +++ b/packages/marketplace/src/components/pages/app-detail/common/__tests__/__snapshots__/ui-sections.test.tsx.snap @@ -301,6 +301,7 @@ exports[`ListingPreviewSection should match a snapshot 1`] = `
@@ -379,7 +380,9 @@ exports[`StatusSection should match a snapshot where isListed true and is sideba >
Listed - +
`; diff --git a/packages/marketplace/src/components/pages/app-detail/common/ui-app-header.tsx b/packages/marketplace/src/components/pages/app-detail/common/ui-app-header.tsx index 04fdadb48f..cc8fe50c7d 100644 --- a/packages/marketplace/src/components/pages/app-detail/common/ui-app-header.tsx +++ b/packages/marketplace/src/components/pages/app-detail/common/ui-app-header.tsx @@ -2,7 +2,8 @@ import * as React from 'react' import { H3, Grid, GridItem, SubTitleH6 } from '@reapit/elements' import { FaCheck } from 'react-icons/fa' import { AppDetailModel } from '@reapit/foundations-ts-definitions' -import styles from '@/styles/blocks/standalone-app-detail.scss?mod' +import * as styles from '../__styles__/standalone-app-detail' + import { MEDIA_INDEX } from '@/constants/media' import ImagePlaceHolder from '@/assets/images/default-app-icon.jpg' import featureImagePlaceHolder from '@/assets/images/default-feature-image.jpg' diff --git a/packages/marketplace/src/components/pages/app-detail/common/ui-helpers.tsx b/packages/marketplace/src/components/pages/app-detail/common/ui-helpers.tsx index ba299f4bcd..8941a12469 100644 --- a/packages/marketplace/src/components/pages/app-detail/common/ui-helpers.tsx +++ b/packages/marketplace/src/components/pages/app-detail/common/ui-helpers.tsx @@ -1,5 +1,5 @@ import React from 'react' -import styles from '@/styles/blocks/standalone-app-detail.scss?mod' +import * as styles from '../__styles__/standalone-app-detail' import { H5, Content } from '@reapit/elements' diff --git a/packages/marketplace/src/components/pages/app-detail/common/ui-sections.tsx b/packages/marketplace/src/components/pages/app-detail/common/ui-sections.tsx index 2ae6cbb1ad..12743970ba 100644 --- a/packages/marketplace/src/components/pages/app-detail/common/ui-sections.tsx +++ b/packages/marketplace/src/components/pages/app-detail/common/ui-sections.tsx @@ -9,7 +9,7 @@ import { import { AppDetailSection, Tag, ImageSection } from './ui-helpers' import { convertBooleanToYesNoString } from '@/utils/boolean-to-yes-no-string' import { FaCheck, FaExternalLinkAlt } from 'react-icons/fa' -import styles from '@/styles/blocks/standalone-app-detail.scss?mod' +import * as styles from '../__styles__/standalone-app-detail' import { LevelRight, Button, diff --git a/packages/marketplace/src/components/pages/apps/__styles__/index.ts b/packages/marketplace/src/components/pages/apps/__styles__/index.ts new file mode 100644 index 0000000000..f53bb48a8d --- /dev/null +++ b/packages/marketplace/src/components/pages/apps/__styles__/index.ts @@ -0,0 +1,12 @@ +import { css } from 'linaria' + +export const appList = css` + width: auto; + -ms-overflow-style: none; + scrollbar-width: none; + margin: -1rem; + padding: 1rem; + &::-webkit-scrollbar { + display: none; + } +` diff --git a/packages/marketplace/src/components/pages/apps/__tests__/__snapshots__/apps.test.tsx.snap b/packages/marketplace/src/components/pages/apps/__tests__/__snapshots__/apps.test.tsx.snap index 6207c5309f..bcd6a42932 100644 --- a/packages/marketplace/src/components/pages/apps/__tests__/__snapshots__/apps.test.tsx.snap +++ b/packages/marketplace/src/components/pages/apps/__tests__/__snapshots__/apps.test.tsx.snap @@ -58,6 +58,7 @@ exports[`Client should match a snapshot when LOADING false 1`] = `
{ return (
* { margin-bottom: 1rem; } -} - +` diff --git a/packages/marketplace/src/components/pages/installed-apps/__tests__/__snapshots__/installed-app-list.test.tsx.snap b/packages/marketplace/src/components/pages/installed-apps/__tests__/__snapshots__/installed-app-list.test.tsx.snap index 2d2e8b24a3..e358573142 100644 --- a/packages/marketplace/src/components/pages/installed-apps/__tests__/__snapshots__/installed-app-list.test.tsx.snap +++ b/packages/marketplace/src/components/pages/installed-apps/__tests__/__snapshots__/installed-app-list.test.tsx.snap @@ -2,7 +2,7 @@ exports[`InstalledAppList should match a snappshot ListDesktopScreen 1`] = ` ) => ( -
+
{list.map(app => ( ))} @@ -51,7 +51,7 @@ export const ListDesktopScreen = ({ loading, onCardClick, }: Pick) => ( - + {list.map(app => ( diff --git a/packages/marketplace/src/styles/pages/login.scss b/packages/marketplace/src/components/pages/login/__styles__/index.ts similarity index 75% rename from packages/marketplace/src/styles/pages/login.scss rename to packages/marketplace/src/components/pages/login/__styles__/index.ts index 1ec7663e93..766f73d8e1 100644 --- a/packages/marketplace/src/styles/pages/login.scss +++ b/packages/marketplace/src/components/pages/login/__styles__/index.ts @@ -1,21 +1,22 @@ -@import '../base/colors.scss'; +import { css } from 'linaria' +import * as colors from '@/core/__styles__/colors' -.container { +export const container = css` min-width: 100vw; min-height: 100vh; display: flex; justify-content: flex-end; align-items: center; flex-direction: row; - background-color: $white; + background-color: ${colors.white}; @media screen and (max-width: 900px) { flex-direction: column-reverse; } -} +` -.wrapper { - background-color: $white; +export const wrapper = css` + background-color: ${colors.white}; width: 33.33%; padding: 1rem; pointer-events: auto; @@ -49,10 +50,10 @@ @media screen and (min-width: 1200px) { padding: 0 3rem; } -} +` -.image { - background-color: $white; +export const image = css` + background-color: ${colors.white}; width: 66.66%; height: 100vh; font-size: 0; @@ -67,13 +68,13 @@ width: 100%; height: 300px; } -} +` -.register-level { +export const registerLevel = css` flex-direction: column; -} +` -.register { +export const register = css` max-width: 400px; width: 100%; text-align: right; @@ -89,24 +90,24 @@ @media screen and (min-width: 960px) { padding: 0; } -} -.loginForm { +` + +export const loginForm = css` position: relative; .forgotPasswordContainer { position: absolute; right: 0; z-index: 1; } -} +` -.labelTerms { +export const labelTerms = css` font-size: 0.8rem; display: flex; align-items: center; -} +` -// Need this to override default without !important -.loginButton.loginButton { +export const loginButton = css` margin-right: auto; margin-left: auto; -} +` diff --git a/packages/marketplace/src/components/pages/login/__tests__/__snapshots__/login.test.tsx.snap b/packages/marketplace/src/components/pages/login/__tests__/__snapshots__/login.test.tsx.snap index e99ede2a86..70f18a6d54 100644 --- a/packages/marketplace/src/components/pages/login/__tests__/__snapshots__/login.test.tsx.snap +++ b/packages/marketplace/src/components/pages/login/__tests__/__snapshots__/login.test.tsx.snap @@ -56,8 +56,12 @@ exports[`Login should match a snapshot 1`] = ` } > -
-
+
+
- +
-
+
Reapit Graphic - +
void @@ -57,7 +57,7 @@ export const Settings: React.FC = () => { )}
-
+
diff --git a/packages/marketplace/src/styles/blocks/app-card.scss b/packages/marketplace/src/components/ui/app-card/__styles__/index.ts similarity index 53% rename from packages/marketplace/src/styles/blocks/app-card.scss rename to packages/marketplace/src/components/ui/app-card/__styles__/index.ts index 64f8bca60a..6d7dc82638 100644 --- a/packages/marketplace/src/styles/blocks/app-card.scss +++ b/packages/marketplace/src/components/ui/app-card/__styles__/index.ts @@ -1,8 +1,7 @@ -@import '../base/colors.scss'; +import { css } from 'linaria' +import { black } from '@/core/__styles__/colors' -// This solution is a bit shit and will only add an elipsis in webkit browsers -// Sorry but other browsers no-supporty... -.content { +export const content = css` display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; @@ -10,11 +9,11 @@ overflow: hidden; text-overflow: ellipsis; height: 72px; -} +` -.directAPI { - color: $black; +export const directAPI = css` + color: ${black}; font-weight: 400; margin-left: 5px; white-space: nowrap; -} +` diff --git a/packages/marketplace/src/components/ui/__tests__/__snapshots__/app-card.tsx.snap b/packages/marketplace/src/components/ui/app-card/__tests__/__snapshots__/app-card.tsx.snap similarity index 91% rename from packages/marketplace/src/components/ui/__tests__/__snapshots__/app-card.tsx.snap rename to packages/marketplace/src/components/ui/app-card/__tests__/__snapshots__/app-card.tsx.snap index 3133195e34..974b59c567 100644 --- a/packages/marketplace/src/components/ui/__tests__/__snapshots__/app-card.tsx.snap +++ b/packages/marketplace/src/components/ui/app-card/__tests__/__snapshots__/app-card.tsx.snap @@ -19,13 +19,17 @@ exports[`AppCard should match a snapshot 1`] = ` subHeading={ Pete's Proptech World Ltd - + (Direct API) } > -

+

nXXT2zaK807ysWgy8F0WEhIYRP3TgosAtfuiLtQCImoSx0kynxbIF0nkGHU36Oz13kM3DG0Bcsicr8L6eWFKLBg4axlmiOEWcvwHAbBP9LRvoFkCl58k1wjhOExnpaZItEyOT1AXVKv8PE44aMGtVz

diff --git a/packages/marketplace/src/components/ui/__tests__/app-card.tsx b/packages/marketplace/src/components/ui/app-card/__tests__/app-card.tsx similarity index 100% rename from packages/marketplace/src/components/ui/__tests__/app-card.tsx rename to packages/marketplace/src/components/ui/app-card/__tests__/app-card.tsx diff --git a/packages/marketplace/src/components/ui/app-card.tsx b/packages/marketplace/src/components/ui/app-card/app-card.tsx similarity index 96% rename from packages/marketplace/src/components/ui/app-card.tsx rename to packages/marketplace/src/components/ui/app-card/app-card.tsx index 9e7813ad42..e9fcb1284a 100644 --- a/packages/marketplace/src/components/ui/app-card.tsx +++ b/packages/marketplace/src/components/ui/app-card/app-card.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { AppSummaryModel } from '@reapit/foundations-ts-definitions' import { Tile } from '@reapit/elements' -import appCardStyles from '@/styles/blocks/app-card.scss?mod' +import * as appCardStyles from './__styles__' import defaultAppIcon from '@/assets/images/default-app-icon.jpg' import Fade from '@/components/ui/fade' diff --git a/packages/marketplace/src/components/ui/app-card/index.ts b/packages/marketplace/src/components/ui/app-card/index.ts new file mode 100644 index 0000000000..2c4f1e4173 --- /dev/null +++ b/packages/marketplace/src/components/ui/app-card/index.ts @@ -0,0 +1 @@ +export { default } from './app-card' diff --git a/packages/marketplace/src/styles/blocks/app-list.scss b/packages/marketplace/src/components/ui/app-list/__styles__/index.ts similarity index 58% rename from packages/marketplace/src/styles/blocks/app-list.scss rename to packages/marketplace/src/components/ui/app-list/__styles__/index.ts index c4a78a1d1f..749881cfed 100644 --- a/packages/marketplace/src/styles/blocks/app-list.scss +++ b/packages/marketplace/src/components/ui/app-list/__styles__/index.ts @@ -1,9 +1,11 @@ -.container { +import { css } from 'linaria' + +export const container = css` margin-top: 1.5rem; margin-bottom: 1.5rem; -} +` -.loaderContainer { +export const loaderContainer = css` position: absolute; left: 0; right: 0; @@ -12,8 +14,8 @@ display: flex; justify-content: center; align-items: center; -} +` -.contentIsLoading { +export const contentIsLoading = css` opacity: 0.75; -} +` diff --git a/packages/marketplace/src/components/ui/__tests__/__snapshots__/app-list.tsx.snap b/packages/marketplace/src/components/ui/app-list/__tests__/__snapshots__/app-list.tsx.snap similarity index 99% rename from packages/marketplace/src/components/ui/__tests__/__snapshots__/app-list.tsx.snap rename to packages/marketplace/src/components/ui/app-list/__tests__/__snapshots__/app-list.tsx.snap index 44d39e1382..a2ad006104 100644 --- a/packages/marketplace/src/components/ui/__tests__/__snapshots__/app-list.tsx.snap +++ b/packages/marketplace/src/components/ui/app-list/__tests__/__snapshots__/app-list.tsx.snap @@ -5,7 +5,7 @@ exports[`AppList should match a snapshot 1`] = ` className="overflow-hidden mb-4" > = ({ : 'We are unable to find any Apps that match your search criteria. Please try again.'} ) : ( - + {list.map(app => ( +
-
+
Browse Apps - + Search
-
- +
+ Filter diff --git a/packages/marketplace/src/components/ui/app-sidebar/app-sidebar.tsx b/packages/marketplace/src/components/ui/app-sidebar/app-sidebar.tsx index 52dd1a2559..4459f150b7 100644 --- a/packages/marketplace/src/components/ui/app-sidebar/app-sidebar.tsx +++ b/packages/marketplace/src/components/ui/app-sidebar/app-sidebar.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { useSelector } from 'react-redux' import { FlexContainerBasic, H5, Input, Formik, Form, RadioSelect, FormikProps, H6 } from '@reapit/elements' import { useHistory, useLocation } from 'react-router' -import styles from '@/styles/blocks/app-sidebar.scss?mod' +import * as styles from './__styles__' import CategoriesList from '@/components/ui/categories-list' import { FaSearch } from 'react-icons/fa' import { CategoryModel } from '@reapit/foundations-ts-definitions' diff --git a/packages/marketplace/src/components/ui/categories-list/__styles__/index.ts b/packages/marketplace/src/components/ui/categories-list/__styles__/index.ts new file mode 100644 index 0000000000..aac39e5276 --- /dev/null +++ b/packages/marketplace/src/components/ui/categories-list/__styles__/index.ts @@ -0,0 +1,9 @@ +import { css } from 'linaria' +import { forMobileOnly } from '@/core/__styles__/screen-size' + +export const listCategories = css` + ${forMobileOnly} { + display: flex; + flex-wrap: wrap; + } +` diff --git a/packages/marketplace/src/components/ui/__tests__/__snapshots__/categories-list.tsx.snap b/packages/marketplace/src/components/ui/categories-list/__tests__/__snapshots__/categories-list.tsx.snap similarity index 97% rename from packages/marketplace/src/components/ui/__tests__/__snapshots__/categories-list.tsx.snap rename to packages/marketplace/src/components/ui/categories-list/__tests__/__snapshots__/categories-list.tsx.snap index e596b8865d..1b37c3b7a7 100644 --- a/packages/marketplace/src/components/ui/__tests__/__snapshots__/categories-list.tsx.snap +++ b/packages/marketplace/src/components/ui/categories-list/__tests__/__snapshots__/categories-list.tsx.snap @@ -1,7 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`CategoriesList should match a snapshot 1`] = ` -