Skip to content

Commit

Permalink
Merging expo-51-build fixing some design stuff for map
Browse files Browse the repository at this point in the history
  • Loading branch information
danny committed Nov 8, 2024
2 parents 497e3b5 + 756db93 commit 923caca
Show file tree
Hide file tree
Showing 21 changed files with 649 additions and 378 deletions.
45 changes: 44 additions & 1 deletion api/Companies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,52 @@ export enum Locations {
Studiecentrum,
E_huset,
Kårhuset,
Tent,
X_Lab,
Career_Room,
}

export enum Competence{
Architecture,
ArtificialIntelligence,
Usability,
Applications,
Automation,
Computation,
FireSafety,
ComputerSecurity,
Design,
EHealth,
Electronics,
EnergySystems,
Law,
Finance,
Geography,
Sustainability,
IndustrialProcesses,
Interactivity,
Chemistry,
Communications,
Construction,
FoodTechnology,
PharmaceuticalTechnology,
MathematicalModelling,
MaterialsEngineering,
LifeScience,
Mechatronics,
AccidentPrevention,
ProductDevelopment,
Programming,
Planning,
ProjectManagement,
RiskManagement,
TechnologyAndSociety,
CivilEngineering,
Simulations,
Manufacturing,
InterdisciplinaryCompetences,
Physics
}

export enum Position {
Thesis,
TraineeEmployment,
Expand Down Expand Up @@ -63,6 +105,7 @@ export interface PublicCompanyDto {
desiredProgramme: Programme[] | null;
positions: Position[] | null;
industries: Industry[] | null;
desiredCompetences: Competence[] | null;
studentSessionMotivation: string | null;
}

Expand Down
1 change: 1 addition & 0 deletions components/HeaderStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export const HeaderStyles = {
color: Colors.white,
backgroundColor: Colors.arkadNavy,
},
headerTintColor: Colors.white,
};
78 changes: 36 additions & 42 deletions components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,60 @@ import * as React from "react";
import { StyleSheet } from "react-native";

import Colors from "constants/Colors";
import { Image, TextInputProps } from "react-native";
import { TextInput } from "./TextInput";
import { Image, TextInputProps, TextInput as TextInputNative} from "react-native";
import { TextInputWithRef } from "./TextInput";
import { View } from "./Themed";
import { ArkadButton } from "./Buttons";
import { Entypo } from "@expo/vector-icons";
import { useEffect, useState } from "react";
import { forwardRef } from "react";


export interface SearchBarProps extends TextInputProps {
text: string,
onChangeText: (val: string) => void,
toggleFilter: () => void,
modalVisible: boolean,
isFiltered: boolean,
placeHolder: string,
}

export function SearchBar({text, onChangeText, toggleFilter, modalVisible, isFiltered, placeHolder}: SearchBarProps) {
export const SearchBar = forwardRef<TextInputNative, SearchBarProps>(({text, onChangeText, toggleFilter, modalVisible, isFiltered}, searchBarRef) => {
const [focused, setFocused] = React.useState(false);
const [inputText, setInputText] = useState(text);

useEffect(() => {
const handler = setTimeout(() => {
onChangeText(inputText);
}, 200); // some delay

return () => {
clearTimeout(handler);
};
}, [inputText, onChangeText]);

return (
<View style={[styles.searchContainer, {borderColor: focused ? Colors.arkadTurkos : "none"}]}>
<Image source={require("../assets/images/search_icon_black.png")} style={styles.searchIcon} />
<View style={styles.inputContainer}>
<TextInput
style={styles.input}
onChangeText={setInputText}
value={inputText}
placeholder={placeHolder}
placeholderTextColor={Colors.lightGray}
numberOfLines={1}
onBlur={() => setFocused(false)}
onFocus={() => setFocused(true)}
/>
</View>
{!!inputText && (
<ArkadButton style={styles.clearButton} onPress={() => {setInputText("")}} >
<Entypo name="cross" size={24} color="black" />
</ArkadButton>
)}
<Image source={require("../assets/images/search_icon_black.png")} style={styles.searchIcon} />
<View style={styles.inputContainer}>
<TextInputWithRef
style={styles.input}
onChangeText={onChangeText}
value={text}
placeholder={"Search for a company..."}
placeholderTextColor={Colors.lightGray}
numberOfLines={1}
onBlur={() => setFocused(false)}
onFocus={() => setFocused(true)}
ref={searchBarRef}
/>

<ArkadButton style={styles.filterbutton} onPress={() => toggleFilter()}>
{modalVisible ? (
<Entypo name="chevron-up" size={16} color="black" />
) : (
<Image source={require("../assets/images/funnel_icon_black.png")} style={styles.filterIcon} />
</View>
{!!text && (
<ArkadButton style={styles.clearButton} onPress={() => {onChangeText("")}} >
<Entypo name="cross" size={24} color="black" />
</ArkadButton>
)}
{isFiltered && <View style={styles.filterBadge} />}
</ArkadButton>

<ArkadButton style={styles.filterbutton} onPress={() => toggleFilter()}>
{modalVisible ? (
<Entypo name="chevron-up" size={16} color="black" />
) : (
<Image source={require("../assets/images/funnel_icon_black.png")} style={styles.filterIcon} />
)}
{isFiltered && <View style={styles.filterBadge} />}
</ArkadButton>
</View>

);
}
});

const styles = StyleSheet.create({
searchContainer: {
Expand All @@ -78,6 +70,7 @@ const styles = StyleSheet.create({
backgroundColor: Colors.white,
borderWidth: 2,
width: "100%",

},
searchIcon: {
width: 24,
Expand All @@ -94,6 +87,7 @@ const styles = StyleSheet.create({
flex: 1,
borderWidth: 0,
borderRadius: 0,
width: "100%",
},
clearButton: {
height: "100%",
Expand Down
12 changes: 12 additions & 0 deletions components/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ export function TextInput(props: TextInputProps) {
);
}

export const TextInputWithRef = React.forwardRef<TextInputField, TextInputProps>((props, ref) => {
return (
<TextInputField
autoCapitalize="none"
placeholderTextColor={Colors.lightGray}
{...props}
ref={ref}
style={[styles.input, props.style]}
/>
)
})

const styles = StyleSheet.create({
input: {
fontFamily: "main-font-bold",
Expand Down
Loading

0 comments on commit 923caca

Please sign in to comment.