-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e717716
commit 3455d86
Showing
20 changed files
with
2,230 additions
and
612 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ module.exports = { | |
browser: true, | ||
commonjs: true, | ||
es6: true, | ||
node: true, | ||
}, | ||
|
||
// Base config | ||
|
67 changes: 67 additions & 0 deletions
67
app/core/components/HitsInstantSearch/ProjectApplicantHits.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import ProposalCard from "../ProposalCard"; | ||
import { Grid } from "@mui/material"; | ||
import "instantsearch.css/themes/satellite.css"; | ||
import { connectHits } from "react-instantsearch-core"; | ||
|
||
const initials = (preferredName: string, lastName: string) => { | ||
return preferredName.substring(0, 1) + lastName.substring(0, 1); | ||
}; | ||
|
||
interface SearchProjectsOutput { | ||
id: string; | ||
name: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
description: string; | ||
preferredName: string; | ||
lastName: string; | ||
avatarUrl: string; | ||
status: string; | ||
color?: string; | ||
searchSkills?: { name: string }[]; | ||
votesCount: number; | ||
projectMembers: number; | ||
owner?: string; | ||
tierName?: string; | ||
latest_pmw: boolean; | ||
resourcesCount?: number; | ||
} | ||
|
||
interface HitProps { | ||
hits: SearchProjectsOutput[]; | ||
} | ||
|
||
function HitApplicants({ hits }: HitProps) { | ||
return hits.map((hit, i) => { | ||
const skillsname = hit.searchSkills?.map((skillName: any) => ({ | ||
name: skillName.name, | ||
})); | ||
|
||
return ( | ||
<> | ||
<Grid item xs={12} sm={6} lg={4} key={i}> | ||
<ProposalCard | ||
id={hit.id} | ||
title={hit.name} | ||
picture={hit.avatarUrl} | ||
initials={initials(hit.preferredName, hit.lastName)} | ||
date={new Intl.DateTimeFormat([], { | ||
year: "numeric", | ||
month: "long", | ||
day: "2-digit", | ||
}).format(new Date(hit.createdAt))} | ||
description={hit.description} | ||
status={hit.status} | ||
skills={skillsname} | ||
color={hit.color} | ||
votesCount={Number(hit.votesCount)} | ||
tierName={hit.tierName} | ||
projectMembers={Number(hit.projectMembers)} | ||
/> | ||
</Grid> | ||
</> | ||
); | ||
}); | ||
} | ||
|
||
export default connectHits(HitApplicants); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import ProposalCard from "../ProposalCard"; | ||
import { Grid } from "@mui/material"; | ||
import "instantsearch.css/themes/satellite.css"; | ||
import { connectHits } from "react-instantsearch-core"; | ||
|
||
const initials = (preferredName: string, lastName: string) => { | ||
return preferredName.substring(0, 1) + lastName.substring(0, 1); | ||
}; | ||
|
||
interface SearchProjectsOutput { | ||
id: string; | ||
name: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
description: string; | ||
preferredName: string; | ||
lastName: string; | ||
avatarUrl: string; | ||
status: string; | ||
color?: string; | ||
searchSkills?: { name: string }[]; | ||
votesCount: number; | ||
projectMembers: number; | ||
owner?: string; | ||
tierName?: string; | ||
latest_pmw: boolean; | ||
resourcesCount?: number; | ||
} | ||
|
||
interface HitProps { | ||
hits: SearchProjectsOutput[]; | ||
} | ||
|
||
function HitsA({ hits }: HitProps) { | ||
return hits.map((hit, i) => { | ||
const skillsname = hit.searchSkills?.map((skillName: any) => ({ | ||
name: skillName.name, | ||
})); | ||
|
||
return ( | ||
<> | ||
<Grid item xs={12} sm={6} lg={4} key={i}> | ||
<ProposalCard | ||
id={hit.id} | ||
title={hit.name} | ||
picture={hit.avatarUrl} | ||
initials={initials(hit.preferredName, hit.lastName)} | ||
date={new Intl.DateTimeFormat([], { | ||
year: "numeric", | ||
month: "long", | ||
day: "2-digit", | ||
}).format(new Date(hit.createdAt))} | ||
description={hit.description} | ||
status={hit.status} | ||
skills={skillsname} | ||
color={hit.color} | ||
votesCount={Number(hit.votesCount)} | ||
tierName={hit.tierName} | ||
projectMembers={Number(hit.projectMembers)} | ||
/> | ||
</Grid> | ||
</> | ||
); | ||
}); | ||
} | ||
|
||
export default connectHits(HitsA); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { Chip } from "@mui/material"; | ||
import TableCell from "@mui/material/TableCell"; | ||
import TableRow from "@mui/material/TableRow"; | ||
import "instantsearch.css/themes/satellite.css"; | ||
import { connectHits } from "react-instantsearch-core"; | ||
|
||
interface SearchProjectsOutput { | ||
sort: number; | ||
id: string; | ||
name: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
description: string; | ||
preferredName: string; | ||
lastName: string; | ||
avatarUrl: string; | ||
status: string; | ||
color?: string; | ||
searchSkills?: { name: string }[]; | ||
votesCount: number; | ||
projectMembers: number; | ||
owner?: string; | ||
tierName?: string; | ||
latest_pmw: boolean; | ||
resourcesCount?: number; | ||
} | ||
|
||
interface HitProps { | ||
hits: SearchProjectsOutput[]; | ||
} | ||
|
||
function TableHits({ hits }: HitProps) { | ||
return hits.map((hit) => { | ||
return ( | ||
<TableRow key={hit.sort - 1}> | ||
<TableCell> | ||
<a | ||
href={`/projects/${hit.id}`} | ||
style={{ color: "inherit", textDecoration: "none" }} | ||
> | ||
{hit.name} | ||
</a> | ||
</TableCell> | ||
<TableCell> | ||
<Chip | ||
component="a" | ||
href={`/projects?tier=${hit.tierName}`} | ||
clickable | ||
rel="noreferrer" | ||
label={hit.tierName} | ||
/> | ||
</TableCell> | ||
<TableCell> | ||
<a | ||
href={`/projects/${hit.id}`} | ||
style={{ color: "inherit", textDecoration: "none" }} | ||
> | ||
{hit.status} | ||
</a> | ||
</TableCell> | ||
<TableCell>{hit.projectMembers}</TableCell> | ||
<TableCell>{hit.votesCount}</TableCell> | ||
<TableCell> | ||
<a | ||
href={`/projects/${hit.id}`} | ||
style={{ color: "inherit", textDecoration: "none" }} | ||
> | ||
{"Code"} | ||
</a> | ||
</TableCell> | ||
<TableCell>{hit.resourcesCount}</TableCell> | ||
</TableRow> | ||
); | ||
}); | ||
} | ||
|
||
export default connectHits(TableHits); |
56 changes: 56 additions & 0 deletions
56
app/core/components/HitsInstantSearch/TableHitsApplicant.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import TableCell from "@mui/material/TableCell"; | ||
import TableRow from "@mui/material/TableRow"; | ||
import "instantsearch.css/themes/satellite.css"; | ||
import { connectHits } from "react-instantsearch-core"; | ||
|
||
interface SearchProjectsOutput { | ||
sort: number; | ||
id: string; | ||
name: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
description: string; | ||
preferredName: string; | ||
lastName: string; | ||
avatarUrl: string; | ||
status: string; | ||
color?: string; | ||
searchSkills?: { name: string }[]; | ||
votesCount: number; | ||
projectMembers: number; | ||
owner?: string; | ||
tierName?: string; | ||
latest_pmw: boolean; | ||
resourcesCount?: number; | ||
} | ||
|
||
interface HitProps { | ||
hits: SearchProjectsOutput[]; | ||
} | ||
|
||
function TableHitsApplicant({ hits }: HitProps) { | ||
return hits.map((hit) => { | ||
return ( | ||
<TableRow key={hit.sort - 1}> | ||
<TableCell> | ||
<a | ||
href={`/projects/${hit.id}`} | ||
style={{ color: "inherit", textDecoration: "none" }} | ||
> | ||
{hit.name} | ||
</a> | ||
</TableCell> | ||
<TableCell> | ||
<a | ||
href={`/projects/${hit.id}`} | ||
style={{ color: "inherit", textDecoration: "none" }} | ||
> | ||
{"Code"} | ||
</a> | ||
</TableCell> | ||
</TableRow> | ||
); | ||
}); | ||
} | ||
|
||
export default connectHits(TableHitsApplicant); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.