Skip to content

Commit

Permalink
fix: typos in go-ui and storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
samshara committed Dec 27, 2024
1 parent 00cfa74 commit c29f0dd
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 42 deletions.
4 changes: 2 additions & 2 deletions packages/go-ui-storybook/src/stories/BlockLoading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {
BlockLoadingProps,
} from '@ifrc-go/ui';

function Blockloading(props: BlockLoadingProps) {
function BlockLoading(props: BlockLoadingProps) {
return (
// eslint-disable-next-line react/jsx-props-no-spreading
<PureBlockLoading {...props} />
);
}
export default Blockloading;
export default BlockLoading;
7 changes: 2 additions & 5 deletions packages/go-ui-storybook/src/stories/Container.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const WithGridViewAndPadding: Story = {
contentViewType: 'grid',
spacing: 'default',
numPreferredGridContentColumns: 2,
withGridViewInFilter: true,
},
};

Expand All @@ -109,7 +108,7 @@ export const ContainerElementRef: Story = {
},
};

export const WithHeadinglevel: Story = {
export const WithHeadingLevel: Story = {
args: {
heading: 'Container Heading',
headerDescription: 'This is a description for the header',
Expand Down Expand Up @@ -148,7 +147,7 @@ export const NumPreferredGridContentColumns: Story = {
numPreferredGridContentColumns: 2,
},
};
export const Withspacing: Story = {
export const WithSpacing: Story = {
args: {
heading: 'Container Heading',
headerDescription: 'This is a description for the header',
Expand All @@ -158,7 +157,6 @@ export const Withspacing: Story = {
contentViewType: 'default',
spacing: 'none',
numPreferredGridContentColumns: 2,
withGridViewInFilter: true,
},
};

Expand All @@ -172,7 +170,6 @@ export const WithGridViewInFilter: Story = {
contentViewType: 'default',
spacing: 'default',
numPreferredGridContentColumns: 2,
withGridViewInFilter: true,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function Template(args:Args) {
] = useArgs();

// NOTE: We are casting args as props because of discriminated union
// used in RadionInputProps
// used in RadioInputProps
const handleChange = (val: string | undefined, name: string) => {
setArgs({ value: val });
// eslint-disable-next-line react/destructuring-assignment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const options: Option[] = [
},
{
key: '4',
label: 'Forecasst Based Action',
label: 'Forecast Based Action',
},
];
const keySelector = (d: Option) => d.key;
Expand Down Expand Up @@ -106,7 +106,7 @@ function Template(args:Args) {
keySelector={keySelector}
labelSelector={labelSelector}
placeholder="Select an emergency type"
name="searchmultiselectinput"
name="search"
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function Template(args:Args) {
labelSelector={labelSelector}
onChange={handleChange}
value={value}
name="searchselectinput"
name="search"
options={options}
onSearchValueChange={handleSearchValueChange}
searchOptions={filteredOptions}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const Disabled: Story = {
},
};

export const Novalue: Story = {
export const NoValue: Story = {
args: {
name: 'no-value',
options,
Expand Down
28 changes: 14 additions & 14 deletions packages/go-ui-storybook/src/stories/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Table from './Table';
interface Data {
id: number;
name: string;
dateofbirth: string;
dateOfBirth: string;
link: string;
characteristics: string[];
status: string;
Expand All @@ -31,7 +31,7 @@ const data = [
{
id: 1,
name: 'African Elephant',
dateofbirth: '2010-05-12',
dateOfBirth: '2010-05-12',
link: 'https://en.wikipedia.org/wiki/african_elephant',
characteristics: [
'Large',
Expand All @@ -45,7 +45,7 @@ const data = [
{
id: 2,
name: 'Bald Eagle',
dateofbirth: '2012-07-04',
dateOfBirth: '2012-07-04',
link: 'https://en.wikipedia.org/wiki/bald_eagle',
characteristics: [
'Large wingspan',
Expand All @@ -59,7 +59,7 @@ const data = [
{
id: 3,
name: 'Cheetah',
dateofbirth: '2015-03-22',
dateOfBirth: '2015-03-22',
link: 'https://en.wikipedia.org/wiki/cheetah',
characteristics: [
'Fast',
Expand All @@ -73,7 +73,7 @@ const data = [
{
id: 4,
name: 'Dolphin',
dateofbirth: '2013-09-18',
dateOfBirth: '2013-09-18',
link: 'https://en.wikipedia.org/wiki/dolphin',
characteristics: [
'Intelligent',
Expand All @@ -87,7 +87,7 @@ const data = [
{
id: 5,
name: 'Emperor Penguin',
dateofbirth: '2011-12-01',
dateOfBirth: '2011-12-01',
link: 'https://en.wikipedia.org/wiki/emperor_penguin',
characteristics: [
'Large',
Expand All @@ -101,7 +101,7 @@ const data = [
{
id: 6,
name: 'Fennec Fox',
dateofbirth: '2016-01-10',
dateOfBirth: '2016-01-10',
link: 'https://en.wikipedia.org/wiki/fennec_fox',
characteristics: [
'Small',
Expand All @@ -115,7 +115,7 @@ const data = [
{
id: 7,
name: 'Giant Panda',
dateofbirth: '2014-08-23',
dateOfBirth: '2014-08-23',
link: 'https://en.wikipedia.org/wiki/giant_panda',
characteristics: [
'Black and white',
Expand All @@ -129,7 +129,7 @@ const data = [
{
id: 8,
name: 'Great White Shark',
dateofbirth: '2009-06-15',
dateOfBirth: '2009-06-15',
link: 'https://en.wikipedia.org/wiki/great_white_shark',
characteristics: [
'Large',
Expand All @@ -143,11 +143,11 @@ const data = [
{
id: 9,
name: 'Hummingbird',
dateofbirth: '2018-04-05',
dateOfBirth: '2018-04-05',
link: 'https://en.wikipedia.org/wiki/hummingbird',
characteristics: [
'Small',
'Colorful',
'Colourful',
'Fast wings',
],
status: 'Least Concern',
Expand All @@ -157,7 +157,7 @@ const data = [
{
id: 10,
name: 'Indian Tiger',
dateofbirth: '2013-11-11',
dateOfBirth: '2013-11-11',
link: 'https://en.wikipedia.org/wiki/indian_tiger',
characteristics: [
'Striped',
Expand All @@ -183,9 +183,9 @@ const columns = [
(item) => item.name,
),
createDateColumn<Data, number>(
'dateofbirth',
'dateOfBirth',
'Date of Birth',
(item) => item.dateofbirth,
(item) => item.dateOfBirth,
),
createElementColumn<Data, number, { link: string, title: string }>(
'link',
Expand Down
2 changes: 1 addition & 1 deletion packages/go-ui-storybook/src/stories/TextInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Template(args:Args) {
<TextInput
// eslint-disable-next-line react/jsx-props-no-spreading
{...args}
name="textinput"
name="textInput"
onChange={onChange}
value={value}
/>
Expand Down
6 changes: 3 additions & 3 deletions packages/go-ui-storybook/src/stories/Typography.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const SampleText = 'Night; and once again, the while I wait for you, cold

**Font Type:** Sans Serif

**Weights:** 300(light), 400(regular), 500(medium), 600(semibold), 700(blold)
**Weights:** 300(light), 400(regular), 500(medium), 600(semibold), 700(bold)

<Typeset
fontSizes={[
Expand All @@ -60,7 +60,7 @@ export const SampleText = 'Night; and once again, the while I wait for you, cold

**Font Type:** Serif

**Weights:** 300(light), 400(regular), 500(medium), 600(semibold), 700(blold)
**Weights:** 300(light), 400(regular), 500(medium), 600(semibold), 700(bold)

<Typeset
fontSizes={[
Expand All @@ -84,7 +84,7 @@ export const SampleText = 'Night; and once again, the while I wait for you, cold

**Font Type:** Monospace

**Weights:** 300(light), 400(regular), 500(medium), 600(semibold), 700(blold)
**Weights:** 300(light), 400(regular), 500(medium), 600(semibold), 700(bold)

<Typeset
fontSizes={[
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/AlertContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function AlertContainer(props: Props) {
useEffect(
() => {
alerts.filter((alert) => !alert.nonDismissable).forEach((alert) => {
// NOTE: skip if there is alreayd a timeout
// NOTE: skip if there is already a timeout
if (dismissTimeout.current[alert.name]) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/DefaultMessage/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"namespace": "common",
"strings": {
"messageTitleFetching":"Fetching data...",
"messageTitleFilterdDataNotAvailable":"Data is not available for selected filter!",
"messageTitleFilteredDataNotAvailable":"Data is not available for selected filter!",
"messageTitleDataNotAvailable":"Data is not available!",
"messageTitleDataFailedToFetch": "Failed to fetch data!"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/DefaultMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function DefaultMessage(props: Props) {
}

if (filtered) {
return filteredEmptyMessage ?? strings.messageTitleFilterdDataNotAvailable;
return filteredEmptyMessage ?? strings.messageTitleFilteredDataNotAvailable;
}

if (empty) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/NumberOutput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface Props {
*/
invalidText?: React.ReactNode;
/**
* Normalize numer into Millions(M), Billion(B)
* Normalize number into Millions(M), Billion(B)
*/
compact?: boolean;
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export { default as BarChart } from './components/BarChart';
export type { Props as BlockLoadingProps } from './components/BlockLoading';
export { default as BlockLoading } from './components/BlockLoading';

// NOTE: Ovearlay needs to be exported before
// NOTE: Overlay needs to be exported before
// BodyOverlay for styling to work properly
// eslint-disable-next-line simple-import-sort/exports
export { default as Portal } from './components/Portal';
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/utils/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export function getEvenDistribution(min: number, max: number, distribution: numb
return getEvenlyDistributedExcess(additional);
}

export function getEvenlyDistributibleBounds(bounds: Bounds, numBreaks: number): Bounds {
export function getEvenlyDistributableBounds(bounds: Bounds, numBreaks: number): Bounds {
const { left, right } = getEvenDistribution(
bounds.min,
bounds.max,
Expand Down
12 changes: 6 additions & 6 deletions packages/ui/src/utils/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ test('Denormalize List', () => {
districts: [1, 2, 3],
}, {
id: 2,
country: 'Afganistan',
country: 'Afghanistan',
districts: [1, 2, 3, 4, 5],
}];
const expected = [
Expand All @@ -91,27 +91,27 @@ test('Denormalize List', () => {
},
{
id: 2,
country: 'Afganistan',
country: 'Afghanistan',
district: 1,
},
{
id: 2,
country: 'Afganistan',
country: 'Afghanistan',
district: 2,
},
{
id: 2,
country: 'Afganistan',
country: 'Afghanistan',
district: 3,
},
{
id: 2,
country: 'Afganistan',
country: 'Afghanistan',
district: 4,
},
{
id: 2,
country: 'Afganistan',
country: 'Afghanistan',
district: 5,
},
];
Expand Down

0 comments on commit c29f0dd

Please sign in to comment.