Skip to content

Commit

Permalink
Merge branch 'remove-api-refactor'
Browse files Browse the repository at this point in the history
  • Loading branch information
accassid committed Jan 1, 2024
2 parents e16c558 + ca521eb commit 64992f6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ const AutocompleteInput: React.FC<Props> = ({
);
}, [localValue, active, autocompleteOptions])

useEffect(() => {
setFirstRender(true)
setLocalValue(value)
}, [value] )

return (
<div className={styles.autocompleteContainer}>
<label className="sr-only" aria-hidden htmlFor={inputId}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pluralize from "pluralize";
import { useState } from "react";
import {useEffect, useState} from "react";
import styles from "./multiSearchInput.module.scss";
import StyledSelect from "../../layout/StyledSelect/StyledSelect";
import AutocompleteInput from "../AutocompleteInput/AutocompleteInput";
Expand Down
6 changes: 5 additions & 1 deletion src/components/layout/StyledSelect/StyledSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeEvent, useState } from "react";
import {ChangeEvent, useEffect, useState} from "react";
import styles from "./styledSelect.module.scss";

export type Option = { value: string; label: string };
Expand Down Expand Up @@ -31,6 +31,10 @@ const StyledSelect = ({
onChange && onChange(event.target.value);
};

useEffect(() => {
setLocalValue(value);
}, [value]);

return (
<div className={`${selectBackgroundClassName} rounded-l-sm relative`}>
<label htmlFor={id} className="sr-only" aria-hidden="true">
Expand Down
2 changes: 2 additions & 0 deletions src/pages/advanced-search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ const AdvancedSearch = () => {
});
}, []);

console.log(cards)

return (
<>
<SpellbookHead
Expand Down
1 change: 1 addition & 0 deletions src/pages/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export default Search;
export const getServerSideProps: GetServerSideProps = async (context) => {
let query = `${context.query.q}`
if (!query.includes('legal:') && !query.includes('banned:') && !query.includes('format:')) query = `${query} legal:commander`
query = encodeURIComponent(query)
const requestService = new RequestService(context)
const order = context.query.order || DEFAULT_ORDER
const sort = context.query.sort || DEFAULT_SORT
Expand Down

0 comments on commit 64992f6

Please sign in to comment.