-
Notifications
You must be signed in to change notification settings - Fork 2
Migrate Kyper AttentionFilled Icon to MXUI #356
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
base: master
Are you sure you want to change the base?
Changes from all commits
dfe6168
c01512a
7aacc87
5ecbd0f
db6f4d4
47458e5
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 |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| import React from 'react' | ||
| import { Text } from '@mxenabled/mxui' | ||
| import { Icon, Text } from '@mxenabled/mxui' | ||
| import { useTokens } from '@kyper/tokenprovider' | ||
| import { Container } from 'src/components/Container' | ||
| import { AttentionFilled } from '@kyper/icon/AttentionFilled' | ||
|
|
||
| interface ConfigError { | ||
| title: string | ||
|
|
@@ -20,7 +19,12 @@ export const ConfigError: React.FC<ConfigErrorProps> = ({ error }) => { | |
| return ( | ||
| <Container> | ||
| <div style={styles.container}> | ||
| <AttentionFilled color="#4D4D4D" size={32} style={styles.errorIcon} /> | ||
| <Icon | ||
| fill={true} | ||
| name="error" | ||
| size={32} | ||
| sx={{ color: '#4D4D4D', marginBottom: tokens.Spacing.Large }} | ||
|
Collaborator
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. Most of the time I think using Stack spacing={?} is better than adding margins to create space between things. |
||
| /> | ||
| <Text component={'h2'} style={styles.errorTitle} truncate={false} variant="H2"> | ||
| {error.title} | ||
| </Text> | ||
|
|
@@ -45,7 +49,4 @@ const getStyles = (tokens: any) => ({ | |
| errorTitle: { | ||
| marginBottom: tokens.Spacing.Tiny, | ||
| }, | ||
| errorIcon: { | ||
| marginBottom: tokens.Spacing.Large, | ||
| }, | ||
| }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| import React, { useState, useImperativeHandle, useContext } from 'react' | ||
| import { Text } from '@mxenabled/mxui' | ||
| import { Icon, Text } from '@mxenabled/mxui' | ||
| import { Button, TextField } from '@mui/material' | ||
| import ToggleButton from '@mui/material/ToggleButton' | ||
| import ToggleButtonGroup from '@mui/material/ToggleButtonGroup' | ||
| import { AttentionFilled } from '@kyper/icon/AttentionFilled' | ||
| import { useTokens } from '@kyper/tokenprovider' | ||
|
|
||
| import { __ } from 'src/utilities/Intl' | ||
|
|
@@ -170,7 +169,12 @@ export const ConnectSuccessSurvey = React.forwardRef< | |
| )} | ||
| {showErrorMessage && ( | ||
| <div style={styles.errorMessage}> | ||
| <AttentionFilled color="#E32727" size={16} style={styles.errorIcon} /> | ||
| <Icon | ||
| fill={true} | ||
| name="error" | ||
| size={16} | ||
| sx={{ color: '#E32727', marginRight: tokens.Spacing.Tiny }} | ||
|
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. Let's not hardcode #E32727 here. We should be using tokens.
Collaborator
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. Same spacing comment here |
||
| /> | ||
| <Text color="#E32727" sx={{ fontSize: '12px' }} variant="XSmall"> | ||
|
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. Same here. let's use tokens instead of raw values. |
||
| {__('Please select an option before continuing.')} | ||
| </Text> | ||
|
|
@@ -255,9 +259,6 @@ const getStyles = (tokens: any) => ({ | |
| alignItems: 'center', | ||
| width: '100%', | ||
| }, | ||
| errorIcon: { | ||
| marginRight: tokens.Spacing.Tiny, | ||
| }, | ||
| textQuestion: { | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| import React, { useState, useEffect, useRef } from 'react' | ||
| import PropTypes from 'prop-types' | ||
| import { Text } from '@mxenabled/mxui' | ||
| import { Icon, Text } from '@mxenabled/mxui' | ||
| import { useTokens } from '@kyper/tokenprovider' | ||
| import { MessageBox } from '@kyper/messagebox' | ||
| import { AttentionFilled } from '@kyper/icon/AttentionFilled' | ||
| import { defer } from 'rxjs' | ||
| import FocusTrap from 'focus-trap-react' | ||
| import { Button, FormLabel, FormControl } from '@mui/material' | ||
|
|
@@ -171,7 +170,7 @@ export const DeleteMemberSurvey = (props) => { | |
|
|
||
| {isSubmitted && !selectedReason && ( | ||
| <section role="alert" style={styles.errorContent}> | ||
| <AttentionFilled color={tokens.Color.Error300} /> | ||
| <Icon fill={true} name="error" size={16} sx={{ color: tokens.Color.Error300 }} /> | ||
|
Collaborator
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. color prop here as well
Collaborator
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. @platypus801 The token value here would be |
||
| <p style={styles.errorMessage}>{__('Choose a reason for deleting')}</p> | ||
| </section> | ||
| )} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| import React, { useEffect } from 'react' | ||
| import PropTypes from 'prop-types' | ||
| import { AttentionFilled } from '@kyper/icon/AttentionFilled' | ||
| import { useTokens } from '@kyper/tokenprovider' | ||
| import { Text } from '@mxenabled/mxui' | ||
| import { Icon, Text } from '@mxenabled/mxui' | ||
|
|
||
| import { isRunningE2ETests } from 'src/utilities/e2e' | ||
| import { PageviewInfo } from 'src/const/Analytics' | ||
|
|
@@ -27,11 +26,11 @@ export const GenericError = ({ loadError, onAnalyticPageview, subtitle, title }) | |
|
|
||
| return ( | ||
| <div style={styles.container}> | ||
| <AttentionFilled | ||
| color={tokens.TextColor.Default} | ||
| height={48} | ||
| styles={styles.icon} | ||
| width={48} | ||
| <Icon | ||
| fill={true} | ||
| name="error" | ||
| size={48} | ||
| sx={{ color: tokens.TextColor.Default, marginBottom: tokens.Spacing.XLarge }} | ||
|
Collaborator
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. Color prop and stack 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. i believe icons have a color prop so we don't need to use sx. https://mxui.kube.qa.internal.mx/?path=/story/mxui-components-icon--icons. i believe it uses |
||
| /> | ||
| <Text component="h1" truncate={false} variant="H2"> | ||
| {title} | ||
|
|
@@ -57,9 +56,6 @@ function getStyles(tokens) { | |
| padding: tokens.Spacing.XSMALL, | ||
| textAlign: 'center', | ||
| }, | ||
| icon: { | ||
| marginBottom: tokens.Spacing.XLarge, | ||
| }, | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,9 @@ | ||
| import React from 'react' | ||
| import PropTypes from 'prop-types' | ||
|
|
||
| import { Text } from '@mxenabled/mxui' | ||
| import { Icon, Text } from '@mxenabled/mxui' | ||
| import { useTokens } from '@kyper/tokenprovider' | ||
| import { InfoFilled } from '@kyper/icon/InfoFilled' | ||
| import { AttentionFilled } from '@kyper/icon/AttentionFilled' | ||
|
|
||
| import { ReadableStatuses } from 'src/const/Statuses' | ||
|
|
||
|
|
@@ -21,7 +20,12 @@ export const ViewTitle = ({ connectionStatus, title }) => { | |
| <InfoFilled color={tokens.BackgroundColor.MessageBoxHelp} size={24} /> | ||
| )} | ||
| {connectionStatus === ReadableStatuses.REJECTED && ( | ||
| <AttentionFilled color={tokens.BackgroundColor.MessageBoxError} size={24} /> | ||
| <Icon | ||
| fill={true} | ||
| name="error" | ||
| size={24} | ||
| sx={{ color: tokens.BackgroundColor.MessageBoxError }} | ||
|
Collaborator
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. Given that we're trying to get rid of kyper we shouldn't use kyper tokens
Collaborator
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. @platypus801 tokens.BackgroundColor.MessageBoxError is |
||
| /> | ||
| )} | ||
| </div> | ||
| ) | ||
|
|
||
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.
same issue here. we should be using color tokens rather than raw color values.