Code Smells Fix
continuous-integration/drone/push Build is passing Details

pull/23/head
Louison PARANT 1 year ago
parent 6e170687bc
commit c627d3e475

@ -3,5 +3,5 @@ import Profil from "../../Models/Profil";
export default interface IProfileService {
getProfiles(): Promise<Profil[]>,
addProfile(new_profile: Profil): Promise<boolean>,
delProfile(profile_name_to_del: String): Promise<boolean>
delProfile(profile_name_to_del: string): Promise<boolean>
}

@ -25,7 +25,7 @@ export default class ProfileService implements IProfileService {
return true
}
async delProfile(profile_name_to_del: String): Promise<boolean> {
async delProfile(profile_name_to_del: string): Promise<boolean> {
const existing_profiles = await this.getProfiles()
let key: number = -1
for (let current_profile of existing_profiles) {

@ -16,7 +16,6 @@ type ProfileProps = {
export default function ProfileDetails(props) {
const colors = useContext(ColorContext).colors
const navigation = useNavigation()
const [display, setDisplay] = useState("none")
const changeListVisibility = () => {
if (display == "none"){

@ -6,7 +6,6 @@ import ColorContext from '../theme/ColorContext';
import bracketLeft from '../assets/images/angle_bracket_left.png';
import bracketRight from '../assets/images/angle_bracket_right.png';
import EventEmitter from '../screens/EventEmitter';
type ProfileSelectionProps = {
listProfile: Profile[]

@ -8,19 +8,17 @@ import ListWithoutSelect from '../components/ListWithoutSelect';
import ListSelect from '../components/ListSelect';
import EventEmitter from './EventEmitter';
import * as ImagePicker from 'expo-image-picker';
import ProfileService from '../Services/Profiles/ProfileService';
import AsyncStorage from '@react-native-async-storage/async-storage';
export default function CreateProfile(props) {
const colors = useContext(ColorContext).colors
const profile_service = new ProfileService()
const all = []
const die = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Porkless"}, {value: "Vegan"}, {value: "Vegetarian"}, {value: "Pescatarian"}]
const [name, onChangeName] = useState();
const [avatar, setAvatar] = useState<string>('');
const [selectedDiets, setSelectedDiets] = useState([]);
const [selectedAllergies, setSelectedAllergies] = useState([])
const [selectedAllergies] = useState([])
const handleSelectedDiets = (selectedValues) => {
setSelectedDiets(selectedValues);

@ -8,7 +8,6 @@ import ProfileSelection from '../components/ProfileSelection';
import FoodElementText from '../components/FoodElementText';
import ColorContext from '../theme/ColorContext';
import ProfileService from '../Services/Profiles/ProfileService';
import Profil from '../Models/Profil';
import bracketLeft from '../assets/images/angle_bracket_left.png';
import bracketRight from '../assets/images/angle_bracket_right.png';
@ -18,7 +17,6 @@ import EventEmitter from './EventEmitter';
export default function HomePage({ navigation, props }) {
const colors = useContext(ColorContext).colors
const profile_service = new ProfileService()
const profilesHand = [
{name: "None", avatar: "logo.png", isActive: "none"}

@ -9,11 +9,9 @@ import ColorContext from '../theme/ColorContext';
import AsyncStorage from '@react-native-async-storage/async-storage';
import EventEmitter from './EventEmitter';
import { PaperProvider, Portal } from 'react-native-paper';
import ProfileService from '../Services/Profiles/ProfileService';
export default function Profiles({navigation, props}) {
const colors = useContext(ColorContext).colors
const profile_service = new ProfileService()
const [visible, setVisible] = useState(false);
const [profiles, setProfiles] = useState([]);

Loading…
Cancel
Save