Skip to content

Commit

Permalink
exportの形式を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
su-u committed Dec 23, 2023
1 parent b515dc5 commit 7d47ca6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/app/number_comma/NumberComma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { FC } from 'react';
import { Controller, FormProvider } from 'react-hook-form';
import { Col, Grid, Panel, PanelGroup, Row, Form } from 'rsuite';
import { AppLayout } from '@/Layout/App';
import { useNumberComma } from '@/app/number_comma/useNumberComma';
import { useNumberComma, DEFAULT_VALUES, SEPARATOR_LIST } from '@/app/number_comma/useNumberComma';
import { ClearButton } from '@/components/common/Form/ClearButton';
import { CopyButton } from '@/components/common/Form/CopyButton';
import { FormRow } from '@/components/common/Form/FormRow';
Expand All @@ -15,7 +15,7 @@ import { PanelHeader } from '@/components/common/PanelHeader';

export const NumberComma: FC = () => {
const title = '数値区切り';
const { methods, output, SEPARATOR_LIST, DEFAULT_VALUES } = useNumberComma();
const { methods, output } = useNumberComma();

return (
<FormProvider {...methods}>
Expand Down
8 changes: 3 additions & 5 deletions src/app/number_comma/useNumberComma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type NumberCommaForm = {
separator: string;
};

const SEPARATOR_LIST = [
export const SEPARATOR_LIST = [
{
label: ',',
value: ',',
Expand All @@ -16,7 +16,7 @@ const SEPARATOR_LIST = [
},
];

const DEFAULT_VALUES: NumberCommaForm = {
export const DEFAULT_VALUES: NumberCommaForm = {
input: '',
separator: SEPARATOR_LIST[0].value,
};
Expand All @@ -34,12 +34,10 @@ export const useNumberComma = () => {
return {
methods,
output,
SEPARATOR_LIST,
DEFAULT_VALUES,
};
};

export const comma = (num: string, separator: string = ',') => {
const comma = (num: string, separator: string = ',') => {
const [integer, decimal] = num.split('.');
let ret = integer.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, `$1${separator}`);
if (decimal) {
Expand Down
14 changes: 3 additions & 11 deletions src/app/uuid/Uuid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { FC } from 'react';
import { Controller, FormProvider } from 'react-hook-form';
import { Col, Grid, Panel, Row, PanelGroup, Form, Button } from 'rsuite';
import { AppLayout } from '@/Layout/App';
import { useUuid } from '@/app/uuid/useUuid';
import { useUuid, DEFAULT_VALUES } from '@/app/uuid/useUuid';
import { ClearButton } from '@/components/common/Form/ClearButton';
import { CopyButton } from '@/components/common/Form/CopyButton';
import { FormRow } from '@/components/common/Form/FormRow';
Expand All @@ -18,16 +18,8 @@ import { useCopy } from '@/hooks/useCopy';

export const Uuid: FC = () => {
const title = 'UUIDの生成';
const {
methods,
selectData,
control,
output,
onClickGenerateUUID,
DEFAULT_VALUES,
version,
onClickClear,
} = useUuid();
const { methods, selectData, control, output, onClickGenerateUUID, version, onClickClear } =
useUuid();
const { copy } = useCopy();

const requireName = version === 3 || version === 5;
Expand Down
3 changes: 1 addition & 2 deletions src/app/uuid/useUuid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type UuidForm = {
UUIDNamespace: string;
};

const DEFAULT_VALUES: UuidForm = {
export const DEFAULT_VALUES: UuidForm = {
version: 4,
isUppercase: false,
isHyphen: true,
Expand Down Expand Up @@ -86,7 +86,6 @@ export const useUuid = () => {
selectData,
onClickGenerateUUID,
output,
DEFAULT_VALUES,
version,
onClickClear,
};
Expand Down

1 comment on commit 7d47ca6

@vercel
Copy link

@vercel vercel bot commented on 7d47ca6 Dec 23, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

tools-su-u-dev – ./

tools-su-u-dev.vercel.app
tools-su-u-dev-git-main-su-u.vercel.app
tools-su-u-dev-su-u.vercel.app
tools.su-u.dev

Please sign in to comment.