Skip to content

Commit

Permalink
Merge pull request #997 from internxt/fix/share-password-layout
Browse files Browse the repository at this point in the history
Fix/share password layout
  • Loading branch information
CandelR authored Jan 18, 2024
2 parents a51e4b8 + 57b0605 commit c6cd003
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@
"prettier --write"
]
}
}
}
43 changes: 24 additions & 19 deletions src/app/drive/components/ShareDialog/ShareDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -550,39 +550,44 @@ const ShareDialog = (props: ShareDialogProps): JSX.Element => {
))}
</>
) : (
invitedUsers.map((user, index) => (
<User
user={user}
key={user.email}
listPosition={index}
translate={translate}
openUserOptions={openUserOptions}
selectedUserListIndex={selectedUserListIndex}
userOptionsY={userOptionsY}
onRemoveUser={onRemoveUser}
userOptionsEmail={userOptionsEmail}
onChangeRole={handleUserRoleChange}
disableUserOptionsPanel={currentUserFolderRole !== 'owner' && user.email !== props.user.email}
disableRoleChange={currentUserFolderRole !== 'owner'}
/>
))
invitedUsers
.sort((a, b) => {
if (a.email === props.user.email && b.email !== props.user.email) return -1;
return 0;
})
.map((user, index) => (
<User
user={user}
key={user.email}
listPosition={index}
translate={translate}
openUserOptions={openUserOptions}
selectedUserListIndex={selectedUserListIndex}
userOptionsY={userOptionsY}
onRemoveUser={onRemoveUser}
userOptionsEmail={userOptionsEmail}
onChangeRole={handleUserRoleChange}
disableUserOptionsPanel={currentUserFolderRole !== 'owner' && user.email !== props.user.email}
disableRoleChange={currentUserFolderRole !== 'owner'}
/>
))
)}
</div>
</div>

<div className="h-px w-full bg-gray-5" />

{accessMode === 'public' && !isLoading && isUserOwner && (
<div className="flex items-end justify-between align-middle">
<div className="flex items-center justify-between">
<div className="flex flex-col space-y-2.5">
<div className="flex items-center">
<BaseCheckbox checked={isPasswordProtected} onClick={onPasswordCheckboxChange} />
<p className="ml-2 select-none text-base font-medium">
{translate('modals.shareModal.protectSharingModal.protect')}
</p>
<Question
size={14}
className="ml-2 flex items-center justify-center font-medium"
size={20}
className="ml-2 flex items-center justify-center font-medium text-gray-50"
data-tooltip-id="uploadFolder-tooltip"
data-tooltip-place="top"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export const SharePasswordInputDialog = ({
{translate('modals.shareModal.protectSharingModal.buttons.cancel')}
</Button>
<Button variant="primary" onClick={handleConfirm} loading={isLoading} disabled={!password}>
{isLoading && <Spinner className="h-4 w-4" />}
{translate('modals.shareModal.protectSharingModal.buttons.save')}
</Button>
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/app/shared/components/forms/BaseCheckbox/BaseCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Check, Minus } from '@phosphor-icons/react';
import { ReactComponent as Check } from './Check.svg';
import { ReactComponent as Minus } from './Minus.svg';
import React from 'react';

interface BaseCheckboxProps {
Expand Down Expand Up @@ -34,7 +35,7 @@ const BaseCheckbox = ({
indeterminate || checked ? 'border-primary bg-primary' : 'border-gray-30 hover:border-gray-40'
}`}
>
{indeterminate ? <Minus size={16} weight="bold" /> : checked && <Check size={16} weight="bold" />}
{indeterminate ? <Minus className="absolute -inset-px" /> : checked && <Check className="absolute -inset-px" />}
</div>
<input
id={id}
Expand Down
5 changes: 5 additions & 0 deletions src/app/shared/components/forms/BaseCheckbox/Check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/app/shared/components/forms/BaseCheckbox/Minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

:root,
#root {
color-scheme: light dark;
background: rgb(var(--color-surface));
font-family: 'Instrument Sans', sans-serif;
height: 100%;
Expand All @@ -24,6 +23,8 @@

@media (prefers-color-scheme: light) {
:root {
color-scheme: light;

--color-primary: 0 102 255;
--color-primary-dark: 0 88 219;
--color-red: 255 13 0;
Expand Down Expand Up @@ -55,6 +56,8 @@
}

:root.dark {
color-scheme: dark;

--color-primary: 20 114 255;
--color-primary-dark: 0 96 240;
--color-red: 255 61 51;
Expand Down Expand Up @@ -88,6 +91,8 @@

@media (prefers-color-scheme: dark) {
:root {
color-scheme: dark;

--color-primary: 20 114 255;
--color-primary-dark: 0 96 240;
--color-red: 255 61 51;
Expand Down Expand Up @@ -119,6 +124,8 @@
}

:root:not(.dark) {
color-scheme: light;

--color-primary: 0 102 255;
--color-primary-dark: 0 88 219;
--color-red: 255 13 0;
Expand Down

1 comment on commit c6cd003

@vercel
Copy link

@vercel vercel bot commented on c6cd003 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.