react-alert-template-basic
react-alert-template-basic copied to clipboard
Overwrite the width
I am using this basic template for the react-alert library. It works well except my text is just slightly too long and wraps to the second line and doesn't look ideal. I'm wondering if there is a simple way to overwrite the width from this template?
const alertStyle = {
backgroundColor: '#151515',
color: 'white',
padding: '10px',
textTransform: 'uppercase',
borderRadius: '3px',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
boxShadow: '0px 2px 2px 2px rgba(0, 0, 0, 0.03)',
fontFamily: 'Arial',
width: '300px',
boxSizing: 'border-box'
}
The Template returns a React component with style as property. So you can do the following in your App Container:
function App () {
return (
<AlertProvider template={p => <AlertTemplate {...p} style={{width: 600}}/>} {...options}>
...
</AlertProvider>
)
}