/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
examples/with-magic/components/form.js
56 строк
1 KB
Steven
chore(examples): use default prettier for examples/templates (#60530)
12 янв 2024, 02:01
Не верифицирован
12 янв 2024, 02:01
4466ba4
Код
Авторство
О чём код?
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;