From c4fa63df3d816814453b648007ebf391afaa56bd Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 20 Sep 2024 21:42:50 -0400 Subject: [PATCH] Sticky public access toggle (#7617) * Sticky public access toggle * tweak --- .../Sharing/Document/AccessControlList.tsx | 13 ++++++++++--- app/components/Sharing/Document/PublicAccess.tsx | 2 +- app/components/Sharing/components/index.tsx | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/components/Sharing/Document/AccessControlList.tsx b/app/components/Sharing/Document/AccessControlList.tsx index 2dec49efef..63527288b0 100644 --- a/app/components/Sharing/Document/AccessControlList.tsx +++ b/app/components/Sharing/Document/AccessControlList.tsx @@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next"; import styled, { useTheme } from "styled-components"; import Squircle from "@shared/components/Squircle"; import { Pagination } from "@shared/constants"; +import { s } from "@shared/styles"; import { CollectionPermission, IconType } from "@shared/types"; import { determineIconType } from "@shared/utils/icon"; import type Collection from "~/models/Collection"; @@ -67,7 +68,7 @@ export const AccessControlList = observer( const containerRef = React.useRef(null); const { maxHeight, calcMaxHeight } = useMaxHeight({ elementRef: containerRef, - maxViewportPercentage: 70, + maxViewportPercentage: 65, margin: 24, }); @@ -201,7 +202,7 @@ export const AccessControlList = observer( )} {team.sharing && can.share && !collectionSharingDisabled && visible && ( - <> + {document.members.length ? : null} - + )} ); @@ -274,6 +275,12 @@ function useUsersInCollection(collection?: Collection) { : false; } +const Sticky = styled.div` + background: ${s("menuBackground")}; + position: sticky; + bottom: -12px; +`; + const ScrollableContainer = styled(Scrollable)` padding: 12px 24px; margin: -12px -24px; diff --git a/app/components/Sharing/Document/PublicAccess.tsx b/app/components/Sharing/Document/PublicAccess.tsx index ad4eb21b47..4855cb2b5b 100644 --- a/app/components/Sharing/Document/PublicAccess.tsx +++ b/app/components/Sharing/Document/PublicAccess.tsx @@ -203,7 +203,7 @@ const StyledInfoIcon = styled(InfoIcon)` `; const Wrapper = styled.div` - margin-bottom: 8px; + padding-bottom: 8px; `; const DomainPrefix = styled.span` diff --git a/app/components/Sharing/components/index.tsx b/app/components/Sharing/components/index.tsx index 51087ea1f6..a97bd8584a 100644 --- a/app/components/Sharing/components/index.tsx +++ b/app/components/Sharing/components/index.tsx @@ -15,7 +15,7 @@ export const Wrapper = styled.div` export const Separator = styled.div` border-top: 1px dashed ${s("divider")}; - margin: 12px 0; + margin: 8px 0; `; export const HeaderInput = styled(Flex)`