-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from LMacPhail/smaller-ui-fixes
Smaller UI fixes
- Loading branch information
Showing
16 changed files
with
542 additions
and
54 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
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
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
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
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
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
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 |
---|---|---|
@@ -1,6 +1,48 @@ | ||
import React from "react"; | ||
import { PolicyStance } from "./PolicyStance"; | ||
import { SearchInput } from "../SearchInput"; | ||
|
||
export const Filters: React.FC = () => { | ||
return <PolicyStance />; | ||
return ( | ||
<div className=""> | ||
<SearchInput /> | ||
</div> | ||
); | ||
}; | ||
|
||
// type SelectedSortDirection = "ascending" | "descending"; | ||
|
||
// TODO: Not make this break everything | ||
// const SortByDropdown: React.FC = () => { | ||
// const dispatch = useDispatch(); | ||
// const profiles = useSelector((state: AppState) => state.data.profiles); | ||
|
||
// const [sortDirection, setSortDirection] = useState< | ||
// SelectedSortDirection | undefined | ||
// >(undefined); | ||
|
||
// const handleSelectChange = (value: SelectedSortDirection) => { | ||
// const sortedProfiles = sortByWin(profiles, value === "descending"); | ||
// dispatch({ | ||
// type: SET_DATA_ACTION, | ||
// payload: { profiles: sortedProfiles, status: "complete" }, | ||
// }); | ||
// setSortDirection(value); | ||
// }; | ||
|
||
// return ( | ||
// <select | ||
// className="select select-ghost-primary" | ||
// value={sortDirection} | ||
// onChange={(event) => | ||
// handleSelectChange(event.target.value as SelectedSortDirection) | ||
// } | ||
// aria-label="sort profiles" | ||
// > | ||
// {sortDirection === undefined && ( | ||
// <option>Sort by chance of winning</option> | ||
// )} | ||
// <option>Most Likely to Win</option> | ||
// <option>Least Likely to Win</option> | ||
// </select> | ||
// ); | ||
// }; |
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
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { extractLinks } from "./string"; | ||
import { extractContacts, extractLinks } from "./string"; | ||
|
||
describe("extractLinks", () => { | ||
const basic = "Something something https://something.com"; | ||
|
@@ -22,3 +22,19 @@ describe("extractLinks", () => { | |
expect(formatted.content[1]).toEqual("Bleep bloop"); | ||
}); | ||
}); | ||
|
||
describe("extractContacts", () => { | ||
it("extracts just an email", () => { | ||
const contact = extractContacts("[email protected]"); | ||
expect(contact?.email).toBe("[email protected]"); | ||
expect(contact?.phone).toBe(undefined); | ||
}); | ||
|
||
it("extracts email and a phone from the same string", () => { | ||
const contact = extractContacts( | ||
"[email protected] / 0121 303 2039" | ||
); | ||
expect(contact?.email).toBe("[email protected]"); | ||
expect(contact?.phone).toBe("0121 303 2039"); | ||
}); | ||
}); |
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.