Channel Link: Adjust styles for draggable icon (#5732)
Co-authored-by: zubiden <19638254+zubiden@users.noreply.github.com>
This commit is contained in:
parent
d8af6e422d
commit
a59ff30064
@ -28,14 +28,14 @@
|
|||||||
|
|
||||||
.sortableContainer {
|
.sortableContainer {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
:global(.draggable-knob) {
|
|
||||||
margin-top: -0.25rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
margin-left: -1rem;
|
margin-left: -1rem;
|
||||||
margin-right: -1rem;
|
margin-right: -1rem;
|
||||||
|
|
||||||
|
:global(.multiline-item) {
|
||||||
|
padding-inline-end: 3rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ type OwnProps = {
|
|||||||
onEditUsername: (username: string) => void;
|
onEditUsername: (username: string) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
const USERNAME_HEIGHT_PX = 60;
|
const USERNAME_HEIGHT_PX = 56;
|
||||||
|
|
||||||
const ManageUsernames: FC<OwnProps> = ({
|
const ManageUsernames: FC<OwnProps> = ({
|
||||||
chatId,
|
chatId,
|
||||||
@ -170,7 +170,7 @@ const ManageUsernames: FC<OwnProps> = ({
|
|||||||
>
|
>
|
||||||
<ListItem
|
<ListItem
|
||||||
key={usernameData.username}
|
key={usernameData.username}
|
||||||
className={buildClassName('drag-item mb-2 no-icon', styles.item)}
|
className={buildClassName('drag-item no-icon', styles.item)}
|
||||||
narrow
|
narrow
|
||||||
secondaryIcon="more"
|
secondaryIcon="more"
|
||||||
icon={usernameData.isActive ? 'link' : 'link-broken'}
|
icon={usernameData.isActive ? 'link' : 'link-broken'}
|
||||||
|
|||||||
@ -91,10 +91,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-sortable-container .draggable-knob {
|
|
||||||
margin-top: -0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-sortable-item .multiline-item {
|
.settings-sortable-item .multiline-item {
|
||||||
padding-inline-end: 3rem;
|
padding-inline-end: 3rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ type SortState = {
|
|||||||
draggedIndex?: number;
|
draggedIndex?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
const FOLDER_HEIGHT_PX = 68;
|
const FOLDER_HEIGHT_PX = 56;
|
||||||
const runThrottledForLoadRecommended = throttle((cb) => cb(), 60000, true);
|
const runThrottledForLoadRecommended = throttle((cb) => cb(), 60000, true);
|
||||||
|
|
||||||
const SettingsFoldersMain: FC<OwnProps & StateProps> = ({
|
const SettingsFoldersMain: FC<OwnProps & StateProps> = ({
|
||||||
@ -211,7 +211,7 @@ const SettingsFoldersMain: FC<OwnProps & StateProps> = ({
|
|||||||
{canCreateNewFolder && (
|
{canCreateNewFolder && (
|
||||||
<Button
|
<Button
|
||||||
// TODO: Refactor button component to handle icon placemenet with props
|
// TODO: Refactor button component to handle icon placemenet with props
|
||||||
className="settings-button with-icon mb-2"
|
className="settings-button with-icon"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="smaller"
|
size="smaller"
|
||||||
pill
|
pill
|
||||||
@ -248,7 +248,7 @@ const SettingsFoldersMain: FC<OwnProps & StateProps> = ({
|
|||||||
>
|
>
|
||||||
<ListItem
|
<ListItem
|
||||||
key={folder.id}
|
key={folder.id}
|
||||||
className="drag-item mb-2 no-icon settings-sortable-item"
|
className="drag-item no-icon settings-sortable-item"
|
||||||
narrow
|
narrow
|
||||||
inactive
|
inactive
|
||||||
multiline
|
multiline
|
||||||
@ -279,7 +279,7 @@ const SettingsFoldersMain: FC<OwnProps & StateProps> = ({
|
|||||||
isDisabled={isBlocked || !isActive}
|
isDisabled={isBlocked || !isActive}
|
||||||
>
|
>
|
||||||
<ListItem
|
<ListItem
|
||||||
className="drag-item mb-2 no-icon settings-sortable-item"
|
className="drag-item no-icon settings-sortable-item"
|
||||||
narrow
|
narrow
|
||||||
secondaryIcon="more"
|
secondaryIcon="more"
|
||||||
multiline
|
multiline
|
||||||
@ -335,7 +335,6 @@ const SettingsFoldersMain: FC<OwnProps & StateProps> = ({
|
|||||||
|
|
||||||
{recommendedChatFolders.map((folder) => (
|
{recommendedChatFolders.map((folder) => (
|
||||||
<ListItem
|
<ListItem
|
||||||
className="mb-2"
|
|
||||||
narrow
|
narrow
|
||||||
// eslint-disable-next-line react/jsx-no-bind
|
// eslint-disable-next-line react/jsx-no-bind
|
||||||
onClick={() => handleCreateFolderFromRecommended(folder)}
|
onClick={() => handleCreateFolderFromRecommended(folder)}
|
||||||
|
|||||||
@ -19,9 +19,13 @@
|
|||||||
.knob {
|
.knob {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
|
||||||
color: var(--color-text-secondary);
|
color: var(--color-text-secondary);
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
line-height: 1.75;
|
line-height: 1.75;
|
||||||
@ -30,7 +34,6 @@
|
|||||||
transition: opacity 150ms;
|
transition: opacity 150ms;
|
||||||
|
|
||||||
cursor: grab !important;
|
cursor: grab !important;
|
||||||
transform: translateY(-50%);
|
|
||||||
|
|
||||||
.container:hover & {
|
.container:hover & {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
@ -46,3 +49,7 @@
|
|||||||
touch-action: none;
|
touch-action: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
|||||||
@ -164,7 +164,7 @@ const Draggable: FC<OwnProps> = ({
|
|||||||
onTouchStart={handleMouseDown}
|
onTouchStart={handleMouseDown}
|
||||||
style={knobStyle}
|
style={knobStyle}
|
||||||
>
|
>
|
||||||
<Icon name="sort" />
|
<Icon name="sort" className={styles.icon} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user