Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue fixes #120

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/web/app/(auth)/(components)/AuthContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const AuthContainer = ({ children }: { children: ReactNode }) => {
const containerRef = useRef(null);
const [scrollbarPresent, setScrollbarPresent] = useState(false);

const latestYear = new Date()?.getFullYear()

useEffect(() => {
const container = containerRef.current;

Expand Down Expand Up @@ -56,7 +58,7 @@ const AuthContainer = ({ children }: { children: ReactNode }) => {
</main>

<footer className='mt-auto text-f14 text-o-text-medium px-[22px] ms:px-6 lg:px-8 py-5 ms:py-8'>
© Open Banking Nigeria 2023
© Open Banking Nigeria {latestYear}
</footer>
</div>
</section>
Expand Down
330 changes: 330 additions & 0 deletions apps/web/app/(webapp)/(components)/StatusCodeBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,330 @@
import React from 'react'

interface StatusBoxProps {
status: number
}

const StatusCodeBox = ({ status }: StatusBoxProps) => {
return (
status == 100 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-medium3 bg-[#E6E7EB]'>
Continue
</span>
)
: status == 101 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-medium3 bg-[#E6E7EB]'>
Switching Protocols
</span>
)
: status == 102 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-medium3 bg-[#E6E7EB]'>
Processing
</span>
)
: status === 103 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-medium3 bg-[#E6E7EB]'>
Early Hints
</span>
)
: status === 200 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-green'>
Ok
</span>
)
: status === 201 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-green'>
Created
</span>
)
: status === 202 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-green'>
Accepted
</span>
)
: status === 203 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-green'>
Non-Authoritative Information
</span>
)
: status === 204 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-green'>
No Content
</span>
)
: status === 205 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-green'>
Reset Content
</span>
)
: status === 206 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-green'>
Partial Content
</span>
)
: status === 207 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-green'>
Multi-Status
</span>
)
: status === 208 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-green'>
Already Reported
</span>
)
: status === 226 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-green'>
IM Used
</span>
)
: status === 300 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Multiple Choice
</span>
)
: status === 301 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Moved Permanently
</span>
)
: status === 302 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Found
</span>
)
: status === 303 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
See Other
</span>
)
: status === 304 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Not Modified
</span>
)
: status === 305 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Use Proxy
</span>
)
: status === 306 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Unused
</span>
)
: status === 307 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Temporary Redirect
</span>
)
: status === 308 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Permanent Redirect
</span>
)
: status === 400 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Bad Request
</span>
)
: status === 401 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Unauthorized
</span>
)
: status === 402 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Payment Required
</span>
)
: status === 403 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Forbidden
</span>
)
: status === 404 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Not Found
</span>
)
: status === 405 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Method Not Allowed
</span>
)
: status === 406 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Not Acceptable
</span>
)
: status === 407 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Proxy Authentication Required
</span>
)
: status === 408 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Request Timeout
</span>
)
: status === 409 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Conflict
</span>
)
: status === 410 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Gone
</span>
)
: status === 411 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Length Required
</span>
)
: status === 412 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Precondition Failed
</span>
)
: status === 413 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Payload Too Large
</span>
)
: status === 414 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
URI Too Long
</span>
)
: status === 415 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Unsupported Media Type
</span>
)
: status === 416 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Range Not Satisfiable
</span>
)
: status === 417 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Expectation Failed
</span>
)
: status === 418 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
I&#39;m a teapot
</span>
)
: status === 421 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Misdirect Request
</span>
)
: status === 422 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Unprocessable Content
</span>
)
: status === 423 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Locked
</span>
)
: status === 424 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Failed Dependency
</span>
)
: status === 425 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Too Early
</span>
)
: status === 426 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Upgrade Required
</span>
)
: status === 428 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Precondition Required
</span>
)
: status === 429 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Too Many Requests
</span>
)
: status === 431 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Request Header Fields Too Large
</span>
)
: status === 451 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-dark bg-o-status-yellow'>
Unavailable For Legal Reasons
</span>
)
: status === 500 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
Internal Server Error
</span>
)
: status === 501 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
Not Implemented
</span>
)
: status === 502 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
Bad Gateway
</span>
)
: status === 503 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
Service Unavailable
</span>
)
: status === 504 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
Gateway Timeout
</span>
)
: status === 505 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
HTTP Version Not Supported
</span>
)
: status === 506 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
Variant Also Negotiates
</span>
)
: status === 507 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
Insufficient Storage
</span>
)
: status === 508 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
Loop Detected
</span>
)
: status === 510 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
Not Extended
</span>
)
: status === 511 ? (
<span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-white bg-o-status-red'>
Network Authentication Required
</span>
)
: <span className='whitespace-nowrap px-[8px] py-[3px] text-f12 text-center font-[500] w-fit capitalize rounded-full text-o-text-medium3 bg-[#E6E7EB]'>
{status}
</span>
)
}

export default StatusCodeBox
5 changes: 4 additions & 1 deletion apps/web/app/(webapp)/(components)/TableElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { timestampFormatter } from '@/utils/timestampFormatter'
import BooleanBox from './BooleanBox'
import { useRouter } from 'next/navigation'
import moment from 'moment'
import { addEllipsis } from '@/utils/addEllipsisToStrings'

const TableElement = ({
tableHeaders,
Expand Down Expand Up @@ -172,7 +173,9 @@ const TableElement = ({
/>
:
cell.id?.includes('description') ?
<div dangerouslySetInnerHTML={{ __html: cell.getValue() || '' }} /> :
addEllipsis(cell.getValue(), 100)
// <div dangerouslySetInnerHTML={{ __html: cell.getValue() || '' }} />
:
flexRender(cell.column.columnDef.cell, cell.getContext())
}
</td>
Expand Down
24 changes: 0 additions & 24 deletions apps/web/app/(webapp)/(components)/TransparentPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,6 @@ const TransparentPanel = ({
}
};

// let userInterface = (data: any) => {
// return(
// <div
// key={data?.id}
// className='whitespace-nowrap cursor-pointer relative w-fit flex flex-col py-[9px]'
// onClick={() => handleClick(data?.value)}
// >
// <div className={`${currentValue == data?.value ? 'text-o-blue font-[500]' : 'text-o-text-medium3'}
// capitalize text-f14 hover:text-o-blue`}
// >
// {data?.label}
// </div>

// {
// currentValue == data?.value &&
// <motion.div
// className='pane-underline'
// layoutId='transparent-pane-underline'
// ></motion.div>
// }
// </div>
// );
// }

return (
<div className={`overflow-x-auto overflow-y-hidden border-b-[2px] border-[#DCE3EB]
flex items-center gap-[16px] h-[38px] w-full ${containerStyle}`}
Expand Down
Loading