Commit c4e3b22a authored by DESKTOP-J7QTMBR\mikke's avatar DESKTOP-J7QTMBR\mikke
Browse files

cleanup

parent f0039635
......@@ -2,7 +2,6 @@ import React from 'react';
import { Header } from './header/Header';
import "./Layout.css"
import { Searchbar } from './searchbar/searchbar';
import { Filter } from './searchbar/Filter';
import { filterStore } from '../utils/filterStore';
import { Provider } from 'react-redux';
......
......@@ -11,7 +11,6 @@ type IProps = {
}
export const CountryCard: FunctionComponent<IProps> = ({
onClick = () => null,
country,
id
}) => {
......
.ContinentCheckbox{
display: flex;
align-items: flex-start;
gap:30px;
margin-top: 200px;
}
\ No newline at end of file
import React, { FunctionComponent, useState } from 'react';
import { Button, ButtonGroup, Form } from 'react-bootstrap';
import { searchbarStore } from './SearchbarStore';
import React, { FunctionComponent } from 'react';
import { Button, ButtonGroup } from 'react-bootstrap';
//import './CountryCard.css';
......@@ -20,6 +19,7 @@ export const ContinentCheckbox: FunctionComponent<Iprops> = ({ handleClick
<Button variant="secondary" onClick={() =>{handleClick("SA")}}>Sør-Amerika</Button>
<Button variant="secondary" onClick={() =>{handleClick("NA")}}>Nord-Amerika</Button>
<Button variant="secondary" onClick={() =>{handleClick("OC")}}>Oseania</Button>
<Button variant="secondary" onClick={() =>{handleClick("")}}>All</Button>
</ButtonGroup>
</>
......
import { CollapseFilled, ExpandFilled, Settings } from '@navikt/ds-icons';
import React, { FunctionComponent, useState } from 'react';
import { Button, Form } from 'react-bootstrap';
import { Button } from 'react-bootstrap';
import { ContinentCheckbox } from './ContinentCheckbox';
import './Filter.css';
import './ContinentCheckbox.css'
import { filterStore } from '../../utils/filterStore';
type IProps = {
onButtonClick: (value: string[]) => void
......@@ -14,7 +13,7 @@ export const Filter: FunctionComponent<IProps> = ({onButtonClick, filterClick})
const [hidden, setHidden] = useState(true);
const filterOptions = <>
<div className={"Sorting"}>
<div className={""}>
<Button variant="secondary"
onClick={()=> onButtonClick(["name", "ASC"])}>Name abc</Button>
<Button variant="secondary"
......@@ -32,8 +31,8 @@ export const Filter: FunctionComponent<IProps> = ({onButtonClick, filterClick})
return (
<>
<div className={"Filter__Big_Container"}>
<Settings/>
<div>Filter Options</div>
<div><Settings/>Filter Options</div>
<div className={"Filter__Big_Buttons"}>
{filterOptions}
</div>
......@@ -43,8 +42,7 @@ export const Filter: FunctionComponent<IProps> = ({onButtonClick, filterClick})
<div className={"Filter__Container"}>
<div className={'Filter__Title'} onClick={() => setHidden(true)}>
<Settings/>
<div>Options</div>
<div><Settings/>Options</div>
<CollapseFilled />
</div>
<div className={'Filter__Options'}>
......
[
{
"AD": {
"name": "Andorra",
"native": "Andorra",
"phone": "376",
"continent": "EU",
"capital": "Andorra la Vella",
"currency": "EUR",
"languages": [
"ca"
]
},
"AE": {
"name": "United Arab Emirates",
"native": "دولة الإمارات العربية المتحدة",
"phone": "971",
"continent": "AS",
"capital": "Abu Dhabi",
"currency": "AED",
"languages": [
"ar"
]
},
"AF": {
"name": "Afghanistan",
"native": "افغانستان",
"phone": "93",
"continent": "AS",
"capital": "Kabul",
"currency": "AFN",
"languages": [
"ps",
"uz",
"tk"
]
},
"AG": {
"name": "Antigua and Barbuda",
"native": "Antigua and Barbuda",
"phone": "1268",
"continent": "NA",
"capital": "Saint John's",
"currency": "XCD",
"languages": [
"en"
]
},
"AI": {
"name": "Anguilla",
"native": "Anguilla",
"phone": "1264",
"continent": "NA",
"capital": "The Valley",
"currency": "XCD",
"languages": [
"en"
]
}
}
]
\ No newline at end of file
......@@ -4,7 +4,6 @@ import './SearchbarStore.tsx'
import { searchbarStore } from './SearchbarStore';
import { getAllData, getNumberOfResults } from '../../utils/APIUtil';
import { store } from '../display/Store';
import { connect } from 'react-redux';
import { Filter } from './Filter';
const PAGE_LIMIT: number = 20;
......@@ -78,7 +77,6 @@ export class Searchbar extends React.Component<IProps, IState> {
return (
<>
<div className="searchbar">
<input type="text" className="form-control" placeholder="Enter Country" onInput={(e)=>{this.setState({search_text: e.currentTarget.value});this.setState({page_number: 0});}}/>
<div className="input-group-append">
<button id="search_button" onClick={() => this.onSearch()}
......
import React from 'react';
import axios, {AxiosResponse} from 'axios';
import { Country } from '../interfaces/Country';
......
import { createStore } from 'redux'
export interface filterOptions{
export interface IfilterOptions{
search: string,
start: number,
limit: number,
continent: string,
order: string
}//search: "", start: 0, limit: 0, continent: "", order: ""
const initState: filterOptions = {
const initState: IfilterOptions = {
search: '',
start: 0,
limit: 0,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment