Lit2L / adam-client-website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create T3 App

This is a T3 Stack project bootstrapped with create-t3-app.

What's next? How do I make an app with this?

We try to keep this project as simple as possible, so you can start with just the scaffolding we set up for you, and add additional things later when they become necessary.

If you are not familiar with the different technologies used in this project, please refer to the respective docs. If you still are in the wind, please join our Discord and ask for help.

Learn More

To learn more about the T3 Stack, take a look at the following resources:

You can check out the create-t3-app GitHub repository — your feedback and contributions are welcome!

How do I deploy this?

Follow our deployment guides for Vercel, Netlify and Docker for more information.

About this project

This is a full-stack booking software for a restaurant, built in NextJS, tRPC, Prisma, and TailwindCSS. This project originates from a video series on YouTube

Future Features/Improvementss

  • Add a way for an admin to delete a booking on customer request
  • Add a way for an admin to edit a booking on customer request
  • Implement a proper backend check regarding booking time validity (currently mocked)
  • CSS / UI improvements
  • Option to book for "immidiately" (current time)
  • Prevent Admin from opening later than they are closing (currently possible)

https://client-adam-swimcoach.s3.us-west-1.amazonaws.com/image/Coaching.png?response-content-disposition=inline&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEO7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLXdlc3QtMiJHMEUCIQD1avnrnT0bKkPptmevHEmQcwcpXyMJ1IVCbeQ%2FYDTQVAIgTl0Vg6mCjx%2BECktuM6Nkvwdh01b7baA4bFiFWjbeYVYq7QIIl%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgwzNDc2ODQwNjE5MDYiDN9EKvLXXaDjz3mXjyrBAq5f62DiliIV5WTBMV3TXXxCxPpt9VEBjFZI2OJ%2FSHnUktiSLhRUCzmIJGq%2F86hU6grdvPAJsNN8BwOcIxd16pwLUdTmlF%2F%2Beoza4WEf8cm2D9%2FfiZxnaqspyfn6J1gFTPPcHQrLPGkyzV9sjxH11%2BGdwfk79vlRswReJeWitEP8u78DVE3VLoaqSNwUi%2FSngolvkFF9h1W815akkqGel4lgcGPSZoeLFU30XkA27UQeHBbDcOXYkw%2FwPPYNIqnNNGmG24882wgDUbp%2F58BS92bphQrC3iCy2Uq%2BvGTN23R8aNl16YCvYRNNm03YJ1OYBpLTMH8meM%2FNd%2FYUa4p%2BybvuEZYXu%2BvO9Jshdb%2BEl8eStcHrtHtkDmRyrfHF3pmMWjgvJJMCpHgrPGsQZ1s48w8JcRDtMmLHn%2BrCzrSYvntvxjCj8PyfBjqzAsxJVfRWY4OwKLmqL2hjxMSK1RRq%2FU9i32N%2BiBoFWB0uen9jJXFVwMGIlTTX%2BMgZueYloTUvTRmba19dv%2FnRJS0tKDAKWVizEFQdzGRuLuZ7Y82zufIU5iSLmjzWDl3%2FlHduM3AaTreHeB3Xk7pLzP6KPvJFs2nPmHYPmsL2J5fsNHgRhyR1JDhkMhFPjnwCBR1ZyfaZc%2B%2BLkjAaVQ%2FJKgO6sEAL01jREoy7J4y0Uj6WycqTy8P2vy3Oqd0Dkh8M51G8jkxBIQ5nYMrWOw8YSm4gjtWj4B3nYPhDIoqE1OBIe%2F7qE2F8VRcyNXLcjUAQQ7otkhHFptTfttCSdYK3aEa2DRXfN6TWhQ4niq%2FkV1kpcnO8xNyxZByqay0511hnY7tYHo%2FPTI4fqX2Yaio4KMFcngU%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230301T222931Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Credential=ASIAVB44VYLJJDB2OUW3%2F20230301%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Signature=3def4afd74b688d5ddea9e80de51b61fede2b5e749b05387ef31fd6efeb0f739

https://client-adam-swimcoach.s3.us-west-1.amazonaws.com/e_Eurwo3LgRfkbAQfvC1g.webp?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVB44VYLJPPKCALV3%2F20230301%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20230301T220035Z&X-Amz-Expires=900&X-Amz-Signature=813ad52262db26f9fb36feefff50f990391ef07a9c1fd33833aa0762e7af8a4c&X-Amz-SignedHeaders=host

s3://client-adam-swimcoach/image/Coaching.png

return ( <Listbox value={selected} onChange={(e) => { // remove the 0 in front of the hour if hour is 0-9 if (type === 'openTime') e = e?.replace(/^0/, '')

    changeTime(e, type)
  }}
>
  {({ open }) => (
    <>
      <Listbox.Label className='block w-32 text-center text-sm font-medium text-blue-700'>
        {type === 'openTime' ? 'Opening time' : 'Closing time'}
      </Listbox.Label>
      <div className='relative mt-1'>
        <Listbox.Button className='relative w-full cursor-default rounded-md border border-gray-300 bg-white py-2 pl-3 text-left shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 sm:text-sm'>
          <div className='flex items-center'>
            <span
              aria-label={true ? 'Online' : 'Offline'}
              className={classNames(
                true ? 'bg-green-400' : 'bg-gray-200',
                'inline-block h-2 w-2 flex-shrink-0 rounded-full'
              )}
            />
            <span className='ml-3 block truncate'>{selected}</span>
          </div>
          <span className='pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2'>
            <HiSelector className='h-5 w-5 text-gray-400' aria-hidden='true' />
          </span>
        </Listbox.Button>

        <Transition
          show={open}
          as={Fragment}
          leave='transition ease-in duration-100'
          leaveFrom='opacity-100'
          leaveTo='opacity-0'
        >
          <Listbox.Options className='absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm'>
            {timeOptions.map((time) => {
              return (
                <Listbox.Option
                  key={time}
                  className={({ active }) =>
                    classNames(
                      active ? 'bg-green-600 text-white' : 'text-gray-900',
                      'relative cursor-default select-none py-2 pl-3 pr-9'
                    )
                  }
                  value={time}
                >
                  {({ selected: selectedOption, active }) => (
                    <>
                      <div className='flex items-center'>
                        <span
                          className={classNames(
                            time === selected ? 'bg-green-500' : 'bg-blue-800',
                            'inline-block h-2 w-2 flex-shrink-0 rounded-full'
                          )}
                          aria-hidden='true'
                        />
                        <span
                          className={classNames(
                            selected ? 'font-semibold' : 'font-normal',
                            'ml-3 block truncate'
                          )}
                        >
                          {time}
                          <span className='sr-only'> is {true ? 'online' : 'offline'}</span>
                        </span>
                      </div>

                      {selectedOption ? (
                        <span
                          className={classNames(
                            active ? 'text-white' : 'text-indigo-600',
                            'absolute inset-y-0 right-0 flex items-center pr-4'
                          )}
                        >
                          <HiCheck className='h-5 w-5' aria-hidden='true' />
                        </span>
                      ) : null}
                    </>
                  )}
                </Listbox.Option>
              )
            })}
          </Listbox.Options>
        </Transition>
      </div>
    </>
  )}
</Listbox>

) }

export default TimeSelector

About


Languages

Language:TypeScript 88.7%Language:CSS 8.1%Language:JavaScript 3.2%