Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import Colors from 'styles/Colors';
import Snackbar from 'react-native-snackbar';
export default class SnackbarUtils {
static DURATION_SHORT = Snackbar.LENGTH_SHORT;
static DURATION_LONG = Snackbar.LENGTH_LONG;
static DURATION_INDEFINITE = Snackbar.LENGTH_INDEFINITE;
static showWarning(options) {
SnackbarUtils.showAlert({
type: 'warning',
...options,
});
}
static showInfo(options) {
SnackbarUtils.showAlert({
type: 'info',
...options,
});
}
_onMultiResidenceSelect(residences: (Residence|undefined)[]): void {
if (residences.length < 2) {
Snackbar.show({
duration: Snackbar.LENGTH_LONG,
title: Translations.get('select_at_least_two'),
});
return;
}
this._residencesToCompare = residences;
this.props.setHeaderTitle('compare_residences', Constants.Views.Housing.ResidenceCompare);
this.props.switchView(Constants.Views.Housing.ResidenceCompare);
}