diff --git a/common/styles.js b/common/styles.js index c37c0a51..aa97ca75 100644 --- a/common/styles.js +++ b/common/styles.js @@ -279,3 +279,12 @@ export const PROFILE_PREVIEW_GRID = (theme) => css` grid-template-columns: repeat(auto-fill, minmax(${theme.grids.profile.mobile.width}px, 1fr)); } `; + +export const PAGE_CONTENT_WRAPPER = (theme) => css` + width: 100%; + min-height: calc(100vh - ${theme.sizes.filterNavbar}px) - ${theme.sizes.header}px; + padding: 20px 20px 44px; + @media (max-width: ${theme.sizes.mobile}px) { + padding: 16px 16px 44px; + } +`; diff --git a/components/core/Application.js b/components/core/Application.js index e6c52676..6cec7af3 100644 --- a/components/core/Application.js +++ b/components/core/Application.js @@ -520,7 +520,7 @@ export default class ApplicationPage extends React.Component { > - isOwner + isOwner || !viewer ? false : !!viewer?.following.some((entry) => { return entry.id === data.id; @@ -161,11 +161,12 @@ function Profile({ viewer, data, page, onAction, ...props }) { ); React.useEffect(() => { - let updatedIsFollowing = isOwner - ? false - : !!viewer?.following.some((entry) => { - return entry.id === data.id; - }); + let updatedIsFollowing = + isOwner || !viewer + ? false + : !!viewer?.following.some((entry) => { + return entry.id === data.id; + }); setIsFollowing(updatedIsFollowing); }, [viewer?.following, data?.id]); diff --git a/components/core/Search/index.js b/components/core/Search/index.js index 72ab5ed6..fe950a16 100644 --- a/components/core/Search/index.js +++ b/components/core/Search/index.js @@ -173,22 +173,13 @@ function Dismiss({ css, ...props }) { * Content * -----------------------------------------------------------------------------------------------*/ -const STYLES_SEARCH_CONTENT = (theme) => css` - width: 100%; - min-height: 100vh; - padding: calc(20px + ${theme.sizes.filterNavbar}px) 24px 44px; - @media (max-width: ${theme.sizes.mobile}px) { - padding: calc(31px + ${theme.sizes.filterNavbar}px) 16px 44px; - } -`; - function Content({ onAction, viewer, page }) { const { results } = useSearchStore(); const { files, slates } = results; if (results.files.length === 0 && results.slates.length === 0) { return ( -
+
Sorry we couldn't find any results.
@@ -198,7 +189,7 @@ function Content({ onAction, viewer, page }) { } return ( -
+
css` - width: 100%; - min-height: calc(100vh - ${theme.sizes.filterNavbar}px) - ${theme.sizes.header}px; - padding: 20px 20px 44px; - @media (max-width: ${theme.sizes.mobile}px) { - padding: 16px 16px 44px; - } -`; - export default function SceneFilesFolder({ viewer, page, onAction, isMobile }) { const [index, setIndex] = React.useState(-1); @@ -49,7 +40,7 @@ export default function SceneFilesFolder({ viewer, page, onAction, isMobile }) { index={index} onChange={(index) => setIndex(index)} /> -
+
{objects.length ? ( css` - width: 100%; - min-height: calc(100vh - ${theme.sizes.filterNavbar}px) - ${theme.sizes.header}px; - padding: 20px 20px 44px; - @media (max-width: ${theme.sizes.mobile}px) { - padding: 16px 16px 44px; - } -`; - export default class SceneProfile extends React.Component { state = { notFound: false, @@ -169,10 +160,12 @@ export default class SceneProfile extends React.Component { url={`${Constants.hostname}${this.props.page.pathname}`} > - - -
This user doesn't have any public content
-
+
+ + +
This user doesn't have any public content
+
+
); @@ -199,7 +192,7 @@ export default class SceneProfile extends React.Component { url={`${Constants.hostname}${this.props.page.pathname}`} image={image} > -
+
{user.library?.length ? ( - - -
We were unable to locate that collection
-
+
+ + +
We were unable to locate that collection
+
+
); @@ -268,15 +270,6 @@ const STYLES_RESET_SCENE_PAGE_PADDING = css` } `; -const STYLES_DATAVIEW_WRAPPER = (theme) => css` - width: 100%; - min-height: calc(100vh - ${theme.sizes.filterNavbar}px) - ${theme.sizes.header}px; - padding: 20px 20px 44px; - @media (max-width: ${theme.sizes.mobile}px) { - padding: 16px 16px 44px; - } -`; - class SlatePage extends React.Component { _copy = null; _timeout = null; @@ -452,7 +445,7 @@ class SlatePage extends React.Component { index={this.state.index} onChange={(index) => this.setState({ index })} /> -
+
) : isOwner ? ( -
+
@@ -476,7 +469,7 @@ class SlatePage extends React.Component {
) : ( -
+
There's nothing here :)
)} diff --git a/server.js b/server.js index e83bbb0c..d9b849c3 100644 --- a/server.js +++ b/server.js @@ -295,7 +295,7 @@ app.prepare().then(async () => { let viewer = null; if (id) { - viewer = await Data.getUserById({ + viewer = await ViewerManager.getById({ id, }); }