moved func to utils
This commit is contained in:
@@ -5,6 +5,7 @@ import { ThemeButton, ThemeText } from '../common/ThemeTypes';
|
||||
import { Picker } from '@react-native-picker/picker';
|
||||
import { FontAwesome } from '@expo/vector-icons';
|
||||
import { Colors } from 'react-native/Libraries/NewAppScreen';
|
||||
import { getDefaultFilter } from '../utils/getDefaultFilter';
|
||||
|
||||
const categories = { class: 'Klasse', room: 'Raum', teacher: 'Lehrer' };
|
||||
|
||||
@@ -143,12 +144,4 @@ return (
|
||||
);
|
||||
};
|
||||
|
||||
const getDefaultFilter = (userInformation) => {
|
||||
if (!userInformation) return null;
|
||||
let type = userInformation.usertype == 'pupil' ? 'class' : 'teacher';
|
||||
let value = userInformation.usertype == 'pupil' ? userInformation.classid : userInformation.id;
|
||||
return { type: type, value: value, group: String(userInformation.group) };
|
||||
};
|
||||
|
||||
|
||||
export default FilterModal;
|
||||
|
||||
Reference in New Issue
Block a user