Automatic class sorting with prettier

This commit is contained in:
Aswin V 2022-02-24 23:46:45 +05:30
parent 8bd9290b3c
commit ff4843ce9a
6 changed files with 68 additions and 27 deletions

View File

@ -1,8 +1,8 @@
export default function Footer() {
return (
<footer className='text-gray-600 body-font'>
<div className='container flex flex-col items-center px-5 py-8 mx-auto sm:flex-row'>
<a className='flex items-center justify-center font-medium text-gray-900 title-font md:justify-start'>
<footer className='body-font text-gray-600'>
<div className='container mx-auto flex flex-col items-center px-5 py-8 sm:flex-row'>
<a className='title-font flex items-center justify-center font-medium text-gray-900 md:justify-start'>
<svg
xmlns='http://www.w3.org/2000/svg'
fill='none'
@ -10,13 +10,13 @@ export default function Footer() {
strokeLinecap='round'
strokeLinejoin='round'
strokeWidth={2}
className='w-10 h-10 p-2 text-white bg-indigo-500 rounded-full'
className='h-10 w-10 rounded-full bg-indigo-500 p-2 text-white'
viewBox='0 0 24 24'>
<path d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5' />
</svg>
<span className='ml-3 text-xl'>Mock SAML</span>
</a>
<p className='mt-4 text-sm text-gray-500 sm:ml-4 sm:pl-4 sm:border-l-2 sm:border-gray-200 sm:py-2 sm:mt-0'>
<p className='mt-4 text-sm text-gray-500 sm:ml-4 sm:mt-0 sm:border-l-2 sm:border-gray-200 sm:py-2 sm:pl-4'>
Powered by
<a
href='https://boxyhq.com/'
@ -26,14 +26,14 @@ export default function Footer() {
<strong>BoxyHQ</strong>
</a>
</p>
<span className='inline-flex justify-center mt-4 sm:ml-auto sm:mt-0 sm:justify-start'>
<span className='mt-4 inline-flex justify-center sm:ml-auto sm:mt-0 sm:justify-start'>
<a className='ml-3 text-gray-500'>
<svg
fill='currentColor'
strokeLinecap='round'
strokeLinejoin='round'
strokeWidth={2}
className='w-5 h-5'
className='h-5 w-5'
viewBox='0 0 24 24'>
<path d='M23 3a10.9 10.9 0 01-3.14 1.53 4.48 4.48 0 00-7.86 3v1A10.66 10.66 0 013 4s-4 9 5 13a11.64 11.64 0 01-7 2c9 5 20 0 20-11.5a4.5 4.5 0 00-.08-.83A7.72 7.72 0 0023 3z' />
</svg>

View File

@ -2,10 +2,10 @@ import Link from 'next/link';
export default function Header() {
return (
<header className='text-gray-600 body-font'>
<div className='container flex flex-col flex-wrap items-center p-5 mx-auto md:flex-row'>
<header className='body-font text-gray-600'>
<div className='container mx-auto flex flex-col flex-wrap items-center p-5 md:flex-row'>
<Link href='/'>
<a className='flex items-center mb-4 font-medium text-gray-900 title-font md:mb-0'>
<a className='title-font mb-4 flex items-center font-medium text-gray-900 md:mb-0'>
<svg
xmlns='http://www.w3.org/2000/svg'
fill='none'
@ -13,7 +13,7 @@ export default function Header() {
strokeLinecap='round'
strokeLinejoin='round'
strokeWidth={2}
className='w-10 h-10 p-2 text-white bg-indigo-500 rounded-full'
className='h-10 w-10 rounded-full bg-indigo-500 p-2 text-white'
viewBox='0 0 24 24'>
<path d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5' />
</svg>

39
package-lock.json generated
View File

@ -24,6 +24,8 @@
"eslint": "8.6.0",
"eslint-config-next": "12.0.7",
"postcss": "8.4.6",
"prettier": "^2.5.1",
"prettier-plugin-tailwindcss": "^0.1.8",
"tailwindcss": "3.0.23",
"typescript": "4.5.4"
}
@ -3160,6 +3162,30 @@
"node": ">= 0.8.0"
}
},
"node_modules/prettier": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz",
"integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/prettier-plugin-tailwindcss": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.1.8.tgz",
"integrity": "sha512-hwarSBCswAXa+kqYtaAkFr3Vop9o04WOyZs0qo3NyvW8L7f1rif61wRyq0+ArmVThOuRBcJF5hjGXYk86cwemg==",
"dev": true,
"engines": {
"node": ">=12.17.0"
},
"peerDependencies": {
"prettier": ">=2.2.0"
}
},
"node_modules/progress": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
@ -6182,6 +6208,19 @@
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
"dev": true
},
"prettier": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz",
"integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
"dev": true
},
"prettier-plugin-tailwindcss": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.1.8.tgz",
"integrity": "sha512-hwarSBCswAXa+kqYtaAkFr3Vop9o04WOyZs0qo3NyvW8L7f1rif61wRyq0+ArmVThOuRBcJF5hjGXYk86cwemg==",
"dev": true,
"requires": {}
},
"progress": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",

View File

@ -26,6 +26,8 @@
"eslint": "8.6.0",
"eslint-config-next": "12.0.7",
"postcss": "8.4.6",
"prettier": "2.5.1",
"prettier-plugin-tailwindcss": "0.1.8",
"tailwindcss": "3.0.23",
"typescript": "4.5.4"
}

View File

@ -23,33 +23,33 @@ const Home: React.FC<{ metadata: IdPMetadata }> = ({ metadata }) => {
const { ssoUrl, entityId, certificate } = metadata;
return (
<section className='text-gray-600 body-font'>
<div className='container px-5 py-24 mx-auto'>
<div className='flex flex-col w-full mb-12 text-center'>
<h1 className='mb-4 text-2xl font-medium text-gray-900 sm:text-3xl title-font'>
<section className='body-font text-gray-600'>
<div className='container mx-auto px-5 py-24'>
<div className='mb-12 flex w-full flex-col text-center'>
<h1 className='title-font mb-4 text-2xl font-medium text-gray-900 sm:text-3xl'>
Mock SAML Metadata
</h1>
<p className='mx-auto text-base font-medium leading-relaxed lg:w-2/3'>
A simple mock SAML 2.0 Identity Provider for development and testing the SAML SSO integration.
</p>
</div>
<div className='flex items-end w-full px-8 mx-auto space-y-4 lg:w-2/3 sm:space-x-4 sm:space-y-0 sm:px-0'>
<div className='mx-auto flex w-full items-end space-y-4 px-8 sm:space-x-4 sm:space-y-0 sm:px-0 lg:w-2/3'>
<div className='relative mr-4 lg:w-full'>
<label className='text-sm leading-7 text-gray-600'>SSO URL</label>
<input type='text' defaultValue={ssoUrl} className='w-full input' />
<input type='text' defaultValue={ssoUrl} className='input w-full' />
</div>
<div className='relative mr-4 lg:w-full'>
<label className='text-sm leading-7 text-gray-600'>Entity ID</label>
<input type='text' defaultValue={entityId} className='w-full input' />
<input type='text' defaultValue={entityId} className='input w-full' />
</div>
</div>
<div className='flex items-end w-full px-8 mx-auto mt-5 space-y-4 lg:w-2/3 sm:space-x-4 sm:space-y-0 sm:px-0'>
<div className='mx-auto mt-5 flex w-full items-end space-y-4 px-8 sm:space-x-4 sm:space-y-0 sm:px-0 lg:w-2/3'>
<div className='relative lg:w-full'>
<label className='text-sm leading-7 text-gray-600'>Certificate</label>
<textarea rows={5} defaultValue={certificate} className='w-full input'></textarea>
<textarea rows={5} defaultValue={certificate} className='input w-full'></textarea>
</div>
</div>
<div className='flex items-end w-full px-8 mx-auto mt-5 space-y-4 lg:w-2/3 sm:space-x-4 sm:space-y-0 sm:px-0'>
<div className='mx-auto mt-5 flex w-full items-end space-y-4 px-8 sm:space-x-4 sm:space-y-0 sm:px-0 lg:w-2/3'>
<Link href='/api/saml/metadata/download'>
<a className='button'>Download Metadata</a>
</Link>

View File

@ -45,11 +45,11 @@ export default function Login() {
<Head>
<title>Mock SAML IdP - Login</title>
</Head>
<div className='w-[465px] max-w-[90%] mx-auto relative top-20 p-10 rounded-xl shadow-lg shadow-blue-50 text-[#145698]'>
<h2 className='text-3xl font-bold text-center mb-3'>Login</h2>
<div className='relative top-20 mx-auto w-[465px] max-w-[90%] rounded-xl p-10 text-[#145698] shadow-lg shadow-blue-50'>
<h2 className='mb-3 text-center text-3xl font-bold'>Login</h2>
<form onSubmit={handleSubmit}>
<div>
<label htmlFor='email' className='block mb-2'>
<label htmlFor='email' className='mb-2 block'>
Email
</label>
<input
@ -60,13 +60,13 @@ export default function Login() {
placeholder='jackson'
value={email}
onChange={handleChange}
className='w-[65%] input'
className='input w-[65%]'
title='please provide a mock example.com email address'
/>
<span className='ml-2 w-1/4'>@example.com</span>
</div>
<div className='mt-5'>
<label htmlFor='password' className='block mb-2'>
<label htmlFor='password' className='mb-2 block'>
Password <sup>(Prefilled for you)</sup>
</label>
<input
@ -75,7 +75,7 @@ export default function Login() {
autoComplete='off'
type='password'
defaultValue='samlstrongpassword'
className='w-full input'
className='input w-full'
/>
</div>
<button type='submit' className='button mt-8 w-full'>