Skip to content

Instantly share code, notes, and snippets.

@DZuz14
DZuz14 / script.php
Created December 15, 2016 19:58
Zen dropdown
// The below command is creating a variable that loads the 'departures' template, and loads its children.
// I am curious as to where the date is getting it's instructions on how to display itself.
// Hoping you can shed some light onto the subject.
$departures = $page->get('template=departures')->children('template=departure');
<div class="ctaBox-departure">
<label for="departure">
<?=__('Departure Date')?>: </label>
<select name="departure">
@DZuz14
DZuz14 / Slider.js
Created January 29, 2017 04:30
Start of the higher order component
import React, { Component } from 'react';
export default class Slider extends Component {
constructor(props) {
super(props);
this.state = {}
}
render() {
@DZuz14
DZuz14 / SlideThree.js
Created January 29, 2017 04:31
One of the three slides in the slider.
import React, { Component } from 'react';
const SlideThree= (props) => {
return <div className="slide"></div>
}
export default SlideThree;
@DZuz14
DZuz14 / SlideThreeWithImage.js
Last active January 29, 2017 04:38
One of the slide components with a background image added
import React, { Component } from 'react';
const SlideThree= (props) => {
let background = {
backgroundImage: 'url(aurora.jpg)',
backgroundSize: 'cover',
backgroundPosition: 'center'
}
@DZuz14
DZuz14 / Slider.js
Created January 29, 2017 04:35
Slider with conditionals added
import React, { Component } from 'react';
import SlideOne from './SlideOne';
import SlideTwo from './SlideTwo';
import SlideThree from './SlideThree';
export default class Slider extends Component {
constructor(props) {
super(props);
this.state = {
@DZuz14
DZuz14 / ArrowComponents.js
Last active July 29, 2018 01:23
Left And Right Arrows
import React from 'react';
const RightArrow = () => {
return (
<div className="nextArrow">
<i className="fa fa-arrow-right fa-2x" aria-hidden="true"></i>
</div>
);
}
import React, { Component } from 'react';
import SlideOne from './SlideOne';
import SlideTwo from './SlideTwo';
import SlideThree from './SlideThree';
import RightArrow from './RightArrow';
import LeftArrow from './LeftArrow';
export default class Slider extends Component {
constructor(props) {
super(props);
import React, { Component } from 'react';
const RightArrow = (props) => {
return (
<div onClick={props.nextSlide} className="nextArrow">
<i className="fa fa-arrow-right fa-2x" aria-hidden="true"></i>
</div>
);
}
/*
This is an example of what I am reverting it to.
For full view of the code, visit the repository here https://github.com/DZuz14/react-slider
*/
// This is the Main Slider Component now
import React, { Component } from 'react';
import Slide from './Slide';
@DZuz14
DZuz14 / AddAlarm.js
Last active May 31, 2017 20:29
React Native Component
import React, { Component } from 'react'
import { View, Text, Switch, NativeModules, AsyncStorage } from 'react-native'
import { Slider, Button, FormLabel, FormInput } from 'react-native-elements'
import { medgrey, darkgrey, green, white } from '../utils'
// Java Bridge Component to Native AlarmManager API
const AlarmManager = NativeModules.AlarmManager
export default class AddAlarm extends Component {
constructor(props) {