Skip to content

Commit

Permalink
Merge pull request #538 from DhairyaMajmudar/type/Search
Browse files Browse the repository at this point in the history
Adding types in SearchPage
  • Loading branch information
frouioui authored Apr 29, 2024
2 parents c36d29a + 4512746 commit 81f829b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
6 changes: 5 additions & 1 deletion website/src/pages/SearchPage/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ limitations under the License.
*/
import React from "react";

export default function Hero({ setGitRef }) {
interface HeroProps {
setGitRef: (value: string) => void;
}

export default function Hero({ setGitRef }: HeroProps) {
return (
<section className="h-[30vh] pt-[5vh] flex justify-center items-center">
<div className="p-[3px] bg-gradient-to-br from-primary to-theme rounded-full w-1/2 duration-300 focus-within:p-[1px]">
Expand Down
24 changes: 21 additions & 3 deletions website/src/pages/SearchPage/components/SearchMacro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,25 @@ import { Link } from "react-router-dom";
import {getRange} from "@/common/Macrobench";
import PropTypes from "prop-types";

export default function SearchMacro({ data, gitRef }) {
interface SearchMacroProps {
gitRef: string;
data: Array<string | any>;
}

interface RowProps {
title: string;
value: {
center: string | number;
range: {
infinite: boolean;
unknown: boolean;
value: number;
};
};
fmt?: string;
}

export default function SearchMacro({ data, gitRef }: SearchMacroProps) {
return (
<div className="flex flex-col border border-primary relative rounded-xl bg-background bg-opacity-5 shadow-xl">
<div className="p-5">
Expand Down Expand Up @@ -112,7 +130,7 @@ export default function SearchMacro({ data, gitRef }) {
);
}

function Row({ title, value, fmt }) {
function Row({ title, value, fmt }:RowProps) {
var valFmt = value.center
if (fmt == "time") {
valFmt = secondToMicrosecond(value.center)
Expand Down Expand Up @@ -143,4 +161,4 @@ Row.propTypes = {
}),
}).isRequired,
fmt: PropTypes.oneOf(['time', 'memory']),
};
};

0 comments on commit 81f829b

Please sign in to comment.