Skip to content

Commit

Permalink
Change some jsx code format
Browse files Browse the repository at this point in the history
  • Loading branch information
juneszh committed Sep 19, 2022
1 parent d2ad858 commit 124cca2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 24 deletions.
4 changes: 1 addition & 3 deletions npm/src/components/Console.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ const Console = props => {
for (const [chartKey, chartValue] of Object.entries(global.config.chart)) {
return (
<Col {...chartValue.grid}>
<Card>
{chartComponent(chartKey, chartValue.component, chartValue.config)}
</Card>
<Card children={chartComponent(chartKey, chartValue.component, chartValue.config)} />
</Col>
);
}
Expand Down
8 changes: 5 additions & 3 deletions npm/src/components/Error.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ const Error = props => {
}
}, 1000);
return (
<Button type='primary' onClick={() => { redirect(global.path + '/login'); }} >
{localeValue(':login') + ' (' + countDown + ')'}
</Button>
<Button
type='primary'
onClick={() => { redirect(global.path + '/login'); }}
children={localeValue(':login') + ' (' + countDown + ')'}
/>
);
};

Expand Down
10 changes: 4 additions & 6 deletions npm/src/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ const Home = props => {
href={subValue.url + (subValue.url.indexOf('?') !== -1 ? '&' : '?') + '_title=' + (itemKey === '1' ? localeValue(subValue.title) : subValue.title)}
rel='noopener noreferrer'
onClick={e => menuAction(e, subValue)}
>
{itemKey === '1' ? localeValue(subValue.title) : subValue.title}
</a>
children={itemKey === '1' ? localeValue(subValue.title) : subValue.title}
/>
);
}
item.children.push(children);
Expand All @@ -87,9 +86,8 @@ const Home = props => {
href={itemValue.url + (itemValue.url.indexOf('?') !== -1 ? '&' : '?') + '_title=' + itemValue.title}
rel='noopener noreferrer'
onClick={e => menuAction(e, itemValue)}
>
{itemValue.title}
</a>
children={itemValue.title}
/>
);
}
}
Expand Down
13 changes: 4 additions & 9 deletions npm/src/components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ const Login = props => {
style={{ minHeight: '100vh', height: 'auto', backgroundColor: '#f0f2f5' }}
>
<Col style={{ width: '320px' }}>
<h1 style={{ textAlign: 'center', fontWeight: 'bold', marginBottom: '40px' }} >
{global.title}
</h1>
<h1 style={{ textAlign: 'center', fontWeight: 'bold', marginBottom: '40px' }} children={global.title} />
<Form
form={form}
initialValues={{
Expand Down Expand Up @@ -111,18 +109,15 @@ const Login = props => {
type='primary'
htmlType='submit'
block
>
{localeValue(':login')}
</Button>
children={localeValue(':login')}
/>
</Form.Item>
<Form.Item
name='remember'
valuePropName='checked'
style={{ textAlign: 'right' }}
>
<Checkbox>
{localeValue(':remember')}
</Checkbox>
<Checkbox children={localeValue(':remember')} />
</Form.Item>
</Form>
</Col>
Expand Down
6 changes: 3 additions & 3 deletions npm/src/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const ModelKit = forwardRef((props, ref) => {
setIsModalDestroy(false);
setIsModalOpen(true);
};

const modalMessage = useCallback(event => {
if (event.origin === window.location.origin) {
if (event.data.error === 0) {
Expand All @@ -123,7 +123,7 @@ const ModelKit = forwardRef((props, ref) => {
<Modal title={modalConfig.title}
centered
open={modalOpen}
destroyOnClose = {modalDestroy}
destroyOnClose={modalDestroy}
footer={false}
onCancel={modalHide}
bodyStyle={{ display: 'flex', padding: 0, maxHeight: 'calc(90vh - 55px)', height: modalHeight, transition: 'height .2s ease-out' }}
Expand All @@ -133,7 +133,7 @@ const ModelKit = forwardRef((props, ref) => {
title='modalFrame'
src={modalConfig.url}
style={{ border: 'none', flex: '1 1 auto' }}
></iframe>
/>
</Modal>
);
});
Expand Down

0 comments on commit 124cca2

Please sign in to comment.