Sticky public access toggle (#7617)

* Sticky public access toggle

* tweak
This commit is contained in:
Tom Moor authored and GitHub committed 2024-09-20 18:42:50 -07:00
1 parent 2b42ce0c0f
commit c4fa63df3d
3 files changed
+12 -5

No files matched your search

@@ -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<HTMLDivElement | null>(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 && (
<>
<Sticky>
{document.members.length ? <Separator /> : null}
<PublicAccess
document={document}
@@ -209,7 +210,7 @@ export const AccessControlList = observer(
sharedParent={sharedParent}
onRequestClose={onRequestClose}
/>
</>
</Sticky>
)}
</ScrollableContainer>
);
@@ -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;
@@ -203,7 +203,7 @@ const StyledInfoIcon = styled(InfoIcon)`
`;
const Wrapper = styled.div`
margin-bottom: 8px;
padding-bottom: 8px;
`;
const DomainPrefix = styled.span`
+1 -1
View File
@@ -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)`