Skip to content

Commit

Permalink
replace newProject error with component
Browse files Browse the repository at this point in the history
  • Loading branch information
laushinka committed May 20, 2022
1 parent edfc059 commit 66cd763
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/dashboard/src/components/ErrorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function ErrorMessage(props: { imgSrc: string; imgAlt?: string; message: string
return (
<div className="mt-16 flex space-x-2 py-6 px-6 w-96 justify-between bg-gitpod-kumquat-light rounded-xl">
<div className="pr-3 self-center w-6">
<img src={props.imgSrc} alt={props.imgAlt} />
<img src={props.imgSrc} alt={props.imgAlt || "An error message"} />
</div>
<div className="flex-1 flex flex-col">
<p className="text-gitpod-red text-sm">{props.message}</p>
Expand Down
12 changes: 2 additions & 10 deletions components/dashboard/src/projects/NewProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import moment from "moment";
import { UserContext } from "../user-context";
import { trackEvent } from "../Analytics";
import exclamation from "../images/exclamation.svg";
import ErrorMessage from "../components/ErrorMessage";

export default function NewProject() {
const location = useLocation();
Expand Down Expand Up @@ -744,16 +745,7 @@ function GitProviders(props: {
})}
</div>

{errorMessage && (
<div className="mt-16 flex space-x-2 py-6 px-6 w-96 justify-between bg-gitpod-kumquat-light rounded-xl">
<div className="pr-3 self-center w-6">
<img src={exclamation} />
</div>
<div className="flex-1 flex flex-col">
<p className="text-gitpod-red text-sm">{errorMessage}</p>
</div>
</div>
)}
{errorMessage && <ErrorMessage imgSrc={exclamation} message={errorMessage} />}
</div>
</div>
);
Expand Down

0 comments on commit 66cd763

Please sign in to comment.