mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
## Description This PR ensures that the default prettier config is used for examples and templates. This config is compatible with `prettier@3` as well (upgrading prettier is bigger change that can be a future PR). ## Changes - Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will be needed upgrading to prettier@3) - Added `examples/.prettierrc.json` with default config (this will change every example) - Added `packages/create-next-app/templates/.prettierrc.json` with default config (this will change every template) ## Related - Fixes #54402 - Closes #54409
57 lines
1.2 KiB
JavaScript
57 lines
1.2 KiB
JavaScript
const Form = ({ errorMessage, onSubmit }) => (
|
|
<form onSubmit={onSubmit}>
|
|
<label>
|
|
<span>Email</span>
|
|
<input type="email" name="email" required />
|
|
</label>
|
|
|
|
<div className="submit">
|
|
<button type="submit">Sign Up / Login</button>
|
|
</div>
|
|
|
|
{errorMessage && <p className="error">{errorMessage}</p>}
|
|
|
|
<style jsx>{`
|
|
form,
|
|
label {
|
|
display: flex;
|
|
flex-flow: column;
|
|
}
|
|
label > span {
|
|
font-weight: 600;
|
|
}
|
|
input {
|
|
padding: 8px;
|
|
margin: 0.3rem 0 1rem;
|
|
border: 1px solid #ccc;
|
|
border-radius: 4px;
|
|
}
|
|
.submit {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
.submit > a {
|
|
text-decoration: none;
|
|
}
|
|
.submit > button {
|
|
padding: 0.5rem 1rem;
|
|
cursor: pointer;
|
|
background: #fff;
|
|
border: 1px solid #ccc;
|
|
border-radius: 4px;
|
|
}
|
|
.submit > button:hover {
|
|
border-color: #888;
|
|
}
|
|
.error {
|
|
color: brown;
|
|
margin: 1rem 0 0;
|
|
}
|
|
`}</style>
|
|
</form>
|
|
);
|
|
|
|
export default Form;
|