Fix text colors and visibility throughout app (#19)

This commit is contained in:
Nabarun Gogoi 2023-12-21 14:59:33 +05:30 committed by GitHub
parent 2650fa8867
commit 3133fb989f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 101 additions and 61 deletions

View File

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import { Link, NavLink } from 'react-router-dom'; import { Link, NavLink } from 'react-router-dom';
import { Card, CardBody, Typography } from '@material-tailwind/react';
const Sidebar = () => { const Sidebar = () => {
return ( return (
<div className="flex flex-col h-full p-4"> <div className="flex flex-col h-full p-4">
@ -10,13 +12,17 @@ const Sidebar = () => {
<h3 className="text-black text-2xl">Snowball</h3> <h3 className="text-black text-2xl">Snowball</h3>
</Link> </Link>
</div> </div>
<div>Organization</div> <Card className="-ml-1 my-2">
<CardBody className="p-1 py-2">
<Typography>Organization</Typography>
</CardBody>
</Card>
<div> <div>
<NavLink <NavLink
to="/" to="/"
className={({ isActive }) => (isActive ? 'text-blue-500' : '')} className={({ isActive }) => (isActive ? 'text-blue-500' : '')}
> >
Projects <Typography>Projects</Typography>
</NavLink> </NavLink>
</div> </div>
<div> <div>
@ -24,7 +30,7 @@ const Sidebar = () => {
to="/settings" to="/settings"
className={({ isActive }) => (isActive ? 'text-blue-500' : '')} className={({ isActive }) => (isActive ? 'text-blue-500' : '')}
> >
Settings <Typography>Settings</Typography>
</NavLink> </NavLink>
</div> </div>
</div> </div>

View File

@ -6,6 +6,7 @@ import {
MenuHandler, MenuHandler,
MenuList, MenuList,
MenuItem, MenuItem,
Typography,
} from '@material-tailwind/react'; } from '@material-tailwind/react';
import { relativeTime } from '../../utils/time'; import { relativeTime } from '../../utils/time';
@ -21,10 +22,12 @@ const ProjectCard: React.FC<ProjectCardProps> = ({ project }) => {
<div className="flex gap-2 p-2 items-center"> <div className="flex gap-2 p-2 items-center">
<div>{project.icon}</div> <div>{project.icon}</div>
<div className="grow"> <div className="grow">
<Link to={`projects/${project.id}`} className="text-sm text-gray-700"> <Link to={`projects/${project.id}`}>
{project.name} <Typography>{project.name}</Typography>
<Typography color="gray" variant="small">
{project.domain}
</Typography>
</Link> </Link>
<p className="text-sm text-gray-400">{project.domain}</p>
</div> </div>
<Menu placement="bottom-end"> <Menu placement="bottom-end">
<MenuHandler> <MenuHandler>
@ -36,12 +39,14 @@ const ProjectCard: React.FC<ProjectCardProps> = ({ project }) => {
</MenuList> </MenuList>
</Menu> </Menu>
</div> </div>
<div className="border-slate-200 border-t-2 border-solid p-4 text-gray-500 text-xs"> <div className="border-slate-200 border-t-2 border-solid p-4 bg-gray-50">
<p>{project.latestCommit.message}</p> <Typography variant="small" color="gray">
<p> {project.latestCommit.message}
</Typography>
<Typography variant="small" color="gray">
{relativeTime(project.latestCommit.createdAt)} on{' '} {relativeTime(project.latestCommit.createdAt)} on{' '}
{project.latestCommit.branch} {project.latestCommit.branch}
</p> </Typography>
</div> </div>
</div> </div>
); );

View File

@ -57,12 +57,16 @@ const ProjectSearch = ({ onChange }: ProjectsSearchProps) => {
<div className="relative"> <div className="relative">
<SearchBar {...getInputProps()} /> <SearchBar {...getInputProps()} />
<Card <Card
className={`absolute w-1/2 max-h-100 overflow-y-scroll ${ className={`absolute w-1/2 max-h-100 -mt-1 overflow-y-scroll ${
!(isOpen && items.length) && 'hidden' !(isOpen && items.length) && 'hidden'
}`} }`}
> >
<p>Suggestions</p>
<List {...getMenuProps()}> <List {...getMenuProps()}>
<div className="p-3">
<Typography variant="small" color="gray">
Suggestions
</Typography>
</div>
{items.map((item, index) => ( {items.map((item, index) => (
<ListItem <ListItem
selected={highlightedIndex === index || selectedItem === item} selected={highlightedIndex === index || selectedItem === item}

View File

@ -16,7 +16,7 @@ interface ProjectRepoCardProps {
const ProjectRepoCard: React.FC<ProjectRepoCardProps> = ({ repository }) => { const ProjectRepoCard: React.FC<ProjectRepoCardProps> = ({ repository }) => {
return ( return (
<div className="group flex items-center gap-4 text-gray-500 text-xs hover:bg-gray-100 m-2"> <div className="group flex items-center gap-4 text-gray-500 text-xs hover:bg-gray-100 p-2 cursor-pointer">
<div>^</div> <div>^</div>
<div className="grow"> <div className="grow">
<p className="text-black"> <p className="text-black">

View File

@ -38,7 +38,7 @@ const RepositoryList = () => {
return ( return (
<div className="p-4"> <div className="p-4">
<div className="flex gap-2"> <div className="flex gap-2 mb-2">
<div className="basis-1/3"> <div className="basis-1/3">
<Select <Select
value={selectedUser} value={selectedUser}
@ -73,7 +73,6 @@ const RepositoryList = () => {
<Typography>No repository found</Typography> <Typography>No repository found</Typography>
<Button <Button
className="rounded-full mt-5" className="rounded-full mt-5"
color="white"
size="sm" size="sm"
onClick={handleResetFilters} onClick={handleResetFilters}
> >

View File

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import { IconButton } from '@material-tailwind/react'; import { IconButton, Typography } from '@material-tailwind/react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
@ -15,13 +15,15 @@ interface TemplateCardProps {
const TemplateCard: React.FC<TemplateCardProps> = ({ framework }) => { const TemplateCard: React.FC<TemplateCardProps> = ({ framework }) => {
return ( return (
<Link to={'/projects/create/template'}> <Link to={'/projects/create/template'}>
<div className="h-14 group bg-gray-200 text-gray-500 text-xs border-gray-200 rounded-lg shadow p-4 flex items-center justify-between"> <div className="h-14 group bg-gray-200 border-gray-200 rounded-lg shadow p-4 flex items-center justify-between">
<div className="grow"> <Typography className="grow">
{framework.icon} {framework.icon} {framework.framework}
{framework.framework} </Typography>
</div>
<div> <div>
<IconButton size="sm" className="hidden group-hover:block"> <IconButton
size="sm"
className="rounded-full hidden group-hover:block"
>
{'>'} {'>'}
</IconButton> </IconButton>
</div> </div>

View File

@ -1,7 +1,7 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import toast, { Toaster } from 'react-hot-toast'; import toast, { Toaster } from 'react-hot-toast';
import { Collapse, Button } from '@material-tailwind/react'; import { Collapse, Button, Typography } from '@material-tailwind/react';
import { Stopwatch, setStopWatchOffset } from '../../../../StopWatch'; import { Stopwatch, setStopWatchOffset } from '../../../../StopWatch';
import FormatMillisecond from '../../../../FormatMilliSecond'; import FormatMillisecond from '../../../../FormatMilliSecond';
@ -61,7 +61,11 @@ const DeployStep = ({
<Collapse open={collapse}> <Collapse open={collapse}>
<div className="p-2 text-sm text-gray-500 h-36 overflow-y-scroll"> <div className="p-2 text-sm text-gray-500 h-36 overflow-y-scroll">
{processLogs.map((log, key) => { {processLogs.map((log, key) => {
return <div key={key}>{log}</div>; return (
<Typography variant="small" color="gray" key={key}>
{log}
</Typography>
);
})} })}
<div className="sticky bottom-0 left-1/2 flex justify-center"> <div className="sticky bottom-0 left-1/2 flex justify-center">
<Button <Button

View File

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import { Typography } from '@material-tailwind/react';
import { relativeTime } from '../../../utils/time'; import { relativeTime } from '../../../utils/time';
interface ActivityDetails { interface ActivityDetails {
@ -19,12 +21,14 @@ const ActivityCard = ({ activity }: ActivityCardProps) => {
<div className="flex hover:bg-gray-200 rounded mt-1"> <div className="flex hover:bg-gray-200 rounded mt-1">
<div className="w-4">{activity.authorAvatar}</div> <div className="w-4">{activity.authorAvatar}</div>
<div className="grow text-sm text-gray-500"> <div className="grow">
<p className="text-black">{activity.author}</p> <Typography>{activity.author}</Typography>
<p className="text-xs"> <Typography variant="small" color="gray">
{relativeTime(activity.createdAt)} ^ {activity.branch} {relativeTime(activity.createdAt)} ^ {activity.branch}
</p> </Typography>
<p>{activity.message}</p> <Typography variant="small" color="gray">
{activity.message}
</Typography>
</div> </div>
</div> </div>
); );

View File

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import { Typography } from '@material-tailwind/react';
import ActivityCard from './ActivityCard'; import ActivityCard from './ActivityCard';
import activityDetails from '../../../assets/activities.json'; import activityDetails from '../../../assets/activities.json';
import { ProjectDetails } from '../../../types/project'; import { ProjectDetails } from '../../../types/project';
@ -15,8 +17,10 @@ const OverviewTabPanel = ({ project }: OverviewProps) => (
<div className="flex items-center gap-2 p-2 "> <div className="flex items-center gap-2 p-2 ">
<div>^</div> <div>^</div>
<div className="grow"> <div className="grow">
<p className="text-sm text-gray-700">{project.title}</p> <Typography>{project.name}</Typography>
<p className="text-sm text-gray-400">{project.domain}</p> <Typography variant="small" color="gray">
{project.domain}
</Typography>
</div> </div>
</div> </div>
<div className="flex justify-between p-2 text-sm"> <div className="flex justify-between p-2 text-sm">
@ -25,22 +29,22 @@ const OverviewTabPanel = ({ project }: OverviewProps) => (
</div> </div>
<div className="flex justify-between p-2 text-sm"> <div className="flex justify-between p-2 text-sm">
<p>Source</p> <p>Source</p>
<p>{project.source}</p> <p>^ {project.source}</p>
</div> </div>
<div className="flex justify-between p-2 text-sm"> <div className="flex justify-between p-2 text-sm">
<p>deployment</p> <p>deployment</p>
<p>{project.deployment}</p> <p>{project.deployment} ^</p>
</div> </div>
<div className="flex justify-between p-2 text-sm"> <div className="flex justify-between p-2 text-sm">
<p>Created</p> <p>Created</p>
<p> <p>
{relativeTime(project.createdAt)} by {project.createdBy} {relativeTime(project.createdAt)} by ^ {project.createdBy}
</p> </p>
</div> </div>
</div> </div>
<div className="col-span-2 p-2"> <div className="col-span-2 p-2">
<div className="flex justify-between"> <div className="flex justify-between">
<p>Activity</p> <Typography variant="h6">Activity</Typography>
<button className="text-xs bg-gray-300 rounded-full p-2"> <button className="text-xs bg-gray-300 rounded-full p-2">
See all See all
</button> </button>

View File

@ -35,7 +35,7 @@ const ProjectTabs = ({ project }: ProjectTabsProps) => {
'border-b-2 border-gray-900 text-gray-900 focus:outline-none' 'border-b-2 border-gray-900 text-gray-900 focus:outline-none'
} }
> >
<TabList className="flex border-b border-gray-300 text-gray-400"> <TabList className="flex border-b border-gray-300 text-gray-600">
<Tab className={'p-2 cursor-pointer'}>Overview</Tab> <Tab className={'p-2 cursor-pointer'}>Overview</Tab>
<Tab className={'p-2 cursor-pointer'}>Deployments</Tab> <Tab className={'p-2 cursor-pointer'}>Deployments</Tab>
<Tab className={'p-2 cursor-pointer'}>Database</Tab> <Tab className={'p-2 cursor-pointer'}>Database</Tab>

View File

@ -5,6 +5,7 @@ import {
MenuHandler, MenuHandler,
MenuList, MenuList,
MenuItem, MenuItem,
Typography,
} from '@material-tailwind/react'; } from '@material-tailwind/react';
import { relativeTime } from '../../../../utils/time'; import { relativeTime } from '../../../../utils/time';
@ -28,24 +29,26 @@ interface DeployDetailsCardProps {
const DeployDetailsCard = ({ deployment }: DeployDetailsCardProps) => { const DeployDetailsCard = ({ deployment }: DeployDetailsCardProps) => {
return ( return (
<div className="grid grid-cols-4 gap-2 text-sm text-gray-600 border-b border-gray-300"> <div className="grid grid-cols-4 gap-2 border-b border-gray-300">
<div className="col-span-2"> <div className="col-span-2">
<div className="flex"> <div className="flex">
<p className=" text-gray-900 basis-2/3">{deployment.title}</p> <Typography className=" basis-2/3">{deployment.title}</Typography>
<p className="basis-1/3">{deployment.status}</p> <Typography color="gray" className="basis-1/3">
{deployment.status}
</Typography>
</div> </div>
<p>{deployment.environment}</p> <Typography color="gray">{deployment.environment}</Typography>
</div> </div>
<div className="col-span-1"> <div className="col-span-1">
<p>{deployment.branch}</p> <Typography color="gray">^ {deployment.branch}</Typography>
<p> <Typography color="gray">
{deployment.commit.hash} {deployment.commit.message} ^ {deployment.commit.hash} {deployment.commit.message}
</p> </Typography>
</div> </div>
<div className="col-span-1 flex items-center"> <div className="col-span-1 flex items-center">
<p className="grow"> <Typography color="gray" className="grow">
{relativeTime(deployment.updatedAt)} ^ {deployment.author} {relativeTime(deployment.updatedAt)} ^ {deployment.author}
</p> </Typography>
<Menu placement="bottom-start"> <Menu placement="bottom-start">
<MenuHandler> <MenuHandler>
<button className="self-start">...</button> <button className="self-start">...</button>

View File

@ -2,8 +2,7 @@ import React from 'react';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import toast, { Toaster } from 'react-hot-toast'; import toast, { Toaster } from 'react-hot-toast';
import { Button } from '@material-tailwind/react'; import { Button, Typography, Input } from '@material-tailwind/react';
import { Input } from '@material-tailwind/react';
const PROJECT_ID = '62f87575-7a2b-4951-8156-9f9821j380d'; const PROJECT_ID = '62f87575-7a2b-4951-8156-9f9821j380d';
@ -32,7 +31,7 @@ const GeneralTabPanel = () => {
return ( return (
<form onSubmit={handleSubmit(() => {})}> <form onSubmit={handleSubmit(() => {})}>
<div className="mb-4"> <div className="mb-4">
<h4>Project info</h4> <Typography variant="h6">Project info</Typography>
</div> </div>
<div className="my-2 w-3/5"> <div className="my-2 w-3/5">
<label <label

View File

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { Button } from '@material-tailwind/react'; import { Button, IconButton, Typography } from '@material-tailwind/react';
import ProjectCard from '../components/projects/ProjectCard'; import ProjectCard from '../components/projects/ProjectCard';
import HorizontalLine from '../components/HorizontalLine'; import HorizontalLine from '../components/HorizontalLine';
@ -12,17 +12,23 @@ const Projects = () => {
return ( return (
<div className="bg-white rounded-3xl h-full"> <div className="bg-white rounded-3xl h-full">
<div className="flex p-4"> <div className="flex p-4">
<div className="grow"> <div className="grow mr-2">
<ProjectSearch onChange={() => {}} /> <ProjectSearch onChange={() => {}} />
</div> </div>
<div className="text-gray-300">^</div> <IconButton color="blue" className="rounded-full mr-2">
<div className="text-gray-300">^</div> <Typography variant="h5">+</Typography>
<div className="text-gray-300">^</div> </IconButton>
<div className="mr-2 flex items-center">
<Typography>^</Typography>
</div>
<div className="px-2 py-1 bg-blue-gray-50 rounded-lg">
<Typography variant="lead">SY</Typography>
</div>
</div> </div>
<HorizontalLine /> <HorizontalLine />
<div className="flex p-4"> <div className="flex p-4">
<div className="grow"> <div className="grow">
<h3 className="text-gray-750 text-2xl">Projects</h3> <Typography variant="h4">Projects</Typography>
</div> </div>
<div> <div>
{/* TODO: Create button component */} {/* TODO: Create button component */}

View File

@ -1,7 +1,7 @@
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { useNavigate, useParams } from 'react-router-dom'; import { useNavigate, useParams } from 'react-router-dom';
import { Button } from '@material-tailwind/react'; import { Button, Typography } from '@material-tailwind/react';
import HorizontalLine from '../../components/HorizontalLine'; import HorizontalLine from '../../components/HorizontalLine';
import projects from '../../assets/projects.json'; import projects from '../../assets/projects.json';
@ -22,7 +22,7 @@ const Project = () => {
<div className="bg-white rounded-3xl h-full"> <div className="bg-white rounded-3xl h-full">
{project ? ( {project ? (
<> <>
<div className="flex p-4 gap-4"> <div className="flex p-4 gap-4 items-center">
<Button <Button
variant="outlined" variant="outlined"
className="rounded-full" className="rounded-full"
@ -30,7 +30,9 @@ const Project = () => {
> >
{'<'} {'<'}
</Button> </Button>
<h3 className="grow">{project?.title} </h3> <Typography variant="h3" className="grow">
{project?.title}
</Typography>
<Button className="rounded-full" variant="outlined"> <Button className="rounded-full" variant="outlined">
Open Repo Open Repo
</Button> </Button>

View File

@ -2,6 +2,8 @@ import React from 'react';
import { useForm, Controller } from 'react-hook-form'; import { useForm, Controller } from 'react-hook-form';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { Typography } from '@material-tailwind/react';
import Dropdown from '../../../../components/Dropdown'; import Dropdown from '../../../../components/Dropdown';
const USER_OPTIONS = [ const USER_OPTIONS = [
@ -23,10 +25,10 @@ const CreateRepo = () => {
return ( return (
<form onSubmit={handleSubmit(() => {})}> <form onSubmit={handleSubmit(() => {})}>
<div className="mb-2"> <div className="mb-2">
<h3>Create a repository</h3> <Typography variant="h6">Create a repository</Typography>
<p className="text-sm text-gray-400"> <Typography color="gray">
The project will be cloned into this repository The project will be cloned into this repository
</p> </Typography>
</div> </div>
<div className="mb-2"> <div className="mb-2">
<h5>Framework</h5> <h5>Framework</h5>