Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Prosjekt 4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JogJ
Prosjekt 4
Merge requests
!5
add new toast
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add new toast
feature/toast-ios-android
into
master
Overview
0
Commits
1
Pipelines
0
Changes
3
Merged
Jørgen Rosager
requested to merge
feature/toast-ios-android
into
master
4 years ago
Overview
0
Commits
1
Pipelines
0
Changes
3
Expand
adds new tiny toast which should work for both ios and android (not tested on ios!)
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
c7153b13
1 commit,
4 years ago
3 files
+
34
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
studentbyer/screens/AddReviewScreen.tsx
+
5
−
16
Options
import
*
as
React
from
"
react
"
;
import
{
StyleSheet
,
ToastAndroid
}
from
"
react-native
"
;
import
{
StyleSheet
}
from
"
react-native
"
;
import
{
useSelector
}
from
"
react-redux
"
;
import
{
Rating
}
from
"
react-native-elements
"
;
import
EditScreenInfo
from
"
../components/EditScreenInfo
"
;
import
{
Text
,
View
}
from
"
../components/Themed
"
;
import
{
RootState
}
from
"
../store/store
"
;
import
{
StudentCity
}
from
"
../store/studentCities/interfaces
"
;
import
{
Card
,
Button
}
from
"
react-native-elements
"
;
import
{
Button
}
from
"
react-native-elements
"
;
import
Icon
from
"
react-native-vector-icons/FontAwesome5
"
;
import
AddRating
from
"
../components/AddRating
"
;
import
{
useState
}
from
"
react
"
;
import
Toast
from
"
react-native-
simple
-toast
"
;
import
Toast
from
"
react-native-
tiny
-toast
"
;
import
axios
from
"
axios
"
;
import
{
API
}
from
"
../constants
"
;
import
{
useActions
}
from
"
../hooks/useActions
"
;
@@ -58,19 +55,11 @@ const AddReviewScreen = ({ navigation }) => {
}
};
const
showSuccessToast
=
()
=>
{
/*Toast.showWithGravity(
"Vurderingen din er sendt inn!",
Toast.SHORT,
Toast.TOP
);*/
Toast
.
showSuccess
(
"
Din vurdering har blitt lagt til!
"
);
};
const
showErrorToast
=
(
err
:
String
)
=>
{
/*Toast.showWithGravity(
`Vi fikk følgende feilmelding: ${err}`,
Toast.SHORT,
Toast.TOP
);*/
Toast
.
show
(
`Error:
${
err
}
`
);
};
if
(
studentCity
)
{
return
(
Loading