ghost-portal/packages/page-contracts/src/Banner.tsx
Jaco Greeff bd840b1ac0
Solang 0.1.5+ (#4001)
* Solan 0.1.5+

* Update packages/page-contracts/src/Banner.tsx
2020-11-09 16:35:13 +01:00

50 lines
1.7 KiB
TypeScript

// Copyright 2017-2020 @polkadot/app-contracts authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React from 'react';
import styled from 'styled-components';
import { Button } from '@polkadot/react-components';
import { useToggle } from '@polkadot/react-hooks';
import { useTranslation } from './translate';
interface Props {
className?: string;
}
function Ink3Banner ({ className = '' }: Props): React.ReactElement<Props> | null {
const [isVisible, toggleVisible] = useToggle(true);
const { t } = useTranslation();
if (!isVisible) {
return null;
}
return (
<article className={`${className} warning centered`}>
<div className='box'>
<p>{t<string>('This contracts interface only supports Substrate 2.0+ with contracts using Ink! 3.0+ or Solang 0.1.5+ with the ability to generate the latest metadata formats.')}</p>
<p>{t<string>('Older versions of the contracts ABI cannot be used and will display an error indicating an invalid ABI when uploaded. Ensure you follow the Ink! or solang upgrade instructions if you are using an older version.')}</p>
<p>{t<string>("With the ABI updates, there may still be dragons... the new ABI formats are a complete departure and required a lot of under-the-hood changes. So when something doesn't quite work as expected, please let us know via GH issues.")}</p>
<Button.Group>
<Button
icon='times'
label={t<string>('Understood, close this')}
onClick={toggleVisible}
/>
</Button.Group>
</div>
</article>
);
}
export default React.memo(styled(Ink3Banner)`
.box {
padding: 0 0.5rem;
.ui--Button-Group {
margin-bottom: 0;
}
}
`);