-
Notifications
You must be signed in to change notification settings - Fork 427
RI-7790: update Select Index menu styles #5303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import styled from 'styled-components' | ||
|
|
||
| export const Container = styled.div<React.HTMLAttributes<HTMLDivElement>>` | ||
| height: 36px; | ||
| width: 200px; | ||
| min-width: 80px; | ||
| overflow: hidden; | ||
| position: relative; | ||
| flex-shrink: 0; | ||
| ` | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,3 @@ | ||||||
| import cx from 'classnames' | ||||||
| import React, { useEffect, useState } from 'react' | ||||||
| import { isString } from 'lodash' | ||||||
| import { useDispatch, useSelector } from 'react-redux' | ||||||
|
|
@@ -32,14 +31,15 @@ import { localStorageService } from 'uiSrc/services' | |||||
| import { BrowserStorageItem } from 'uiSrc/constants' | ||||||
|
|
||||||
| import { IconButton } from 'uiSrc/components/base/forms/buttons' | ||||||
| import { ResetIcon } from 'uiSrc/components/base/icons' | ||||||
| import { PlusIcon, ResetIcon } from 'uiSrc/components/base/icons' | ||||||
| import { RiTooltip } from 'uiSrc/components' | ||||||
| import { | ||||||
| RiSelect, | ||||||
| SelectValueRenderParams, | ||||||
| } from 'uiSrc/components/base/forms/select/RiSelect' | ||||||
| import { Text } from 'uiSrc/components/base/text' | ||||||
| import styles from './styles.module.scss' | ||||||
| import { Row } from 'uiSrc/components/base/layout/flex' | ||||||
| import * as S from './RediSearchIndexesList.styles' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is single component there, why this obscurity?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SM's style guide https://github.com/redislabsdev/cloud-ui/blob/master/style-guide/styling-themes.md#-good THis is a scalable solution - does not changes imports in case of multiple components
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did we adopt it officially? Since this was merged, the discussion is pointless, but I disagree with the points it makes regarding imports. When I type in the editor, it does not suggest me to import
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. re 2nd paragraph - as I said, I just moved sass styles to styled components 1:1. Both values you provided (32, 40) are different than what we had - 36. We need to come up with a solution separately regarding these values and usage across codebase.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| export const CREATE = 'create' | ||||||
|
|
||||||
|
|
@@ -98,29 +98,31 @@ const RediSearchIndexesList = (props: Props) => { | |||||
| return { | ||||||
| value: JSON.stringify(index), | ||||||
| inputDisplay: ( | ||||||
| <Text component="span" data-test-subj={`mode-option-type-${value}`}> | ||||||
| {value} | ||||||
| </Text> | ||||||
| <Text data-test-subj={`mode-option-type-${value}`}>{value}</Text> | ||||||
| ), | ||||||
| dropdownDisplay: ( | ||||||
| <Text component="span" data-test-subj={`mode-option-type-${value}`}> | ||||||
| <Text color="primary" data-test-subj={`mode-option-type-${value}`}> | ||||||
| {value} | ||||||
| </Text> | ||||||
| ), | ||||||
| } | ||||||
| }) | ||||||
|
|
||||||
| options.unshift({ | ||||||
| options.push({ | ||||||
| value: JSON.stringify(CREATE), | ||||||
| inputDisplay: <span>CREATE</span>, | ||||||
| dropdownDisplay: ( | ||||||
| <Text | ||||||
| size="M" | ||||||
| className={cx(styles.createIndexBtn)} | ||||||
| data-testid="create-index-btn" | ||||||
| > | ||||||
| Create Index | ||||||
| </Text> | ||||||
| <Row align="center" justify="start" gap="xs"> | ||||||
| <PlusIcon size="M" /> | ||||||
| <Text | ||||||
| size="M" | ||||||
| variant="semiBold" | ||||||
| color="primary" | ||||||
| data-testid="create-index-btn" | ||||||
| > | ||||||
| Create Index | ||||||
| </Text> | ||||||
| </Row> | ||||||
| ), | ||||||
| }) | ||||||
|
|
||||||
|
|
@@ -181,7 +183,7 @@ const RediSearchIndexesList = (props: Props) => { | |||||
| } | ||||||
|
|
||||||
| return ( | ||||||
| <div className={cx(styles.container)}> | ||||||
| <S.Container> | ||||||
| <RiSelect.Compose | ||||||
| disabled={loading} | ||||||
| options={options} | ||||||
|
|
@@ -212,7 +214,7 @@ const RediSearchIndexesList = (props: Props) => { | |||||
| </RiSelect.Trigger.Compose> | ||||||
| <RiSelect.Content optionValueRender={selectValueRender} /> | ||||||
| </RiSelect.Compose> | ||||||
| </div> | ||||||
| </S.Container> | ||||||
| ) | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the style of the container from the sass file; I simply turned it into a styled components to get rid of the unused styles