Skip to content

Instantly share code, notes, and snippets.

@deconstructionalism
deconstructionalism / LocationPage.js
Last active April 22, 2021 21:11
LocationPage.js
import React from 'react'
import MetaTags from 'react-meta-tags'
import PropTypes from 'prop-types'
import MajorFeatures from '../organisms/MajorFeatures.js'
import LocationAddress from '../organisms/LocationAddress.js'
import LocationAnnouncements from '../organisms/LocationAnnouncements.js'
import LocationHero from '../organisms/LocationHero.js'
import LocationUnitInfo from '../organisms/LocationUnitInfo.js'
import LocationGeneralInfo from '../organisms/LocationGeneralInfo.js'

Server Branches

branch description prune
master no
backup-dev-materials Backup of original schema code for materials. no
demo-singletable Demonstrates concrete table inheritance, specifically parent having one and only one of a concrete class instance. no
demo-singletable-mod Demonstrates class table inheritance. no

Client Branches

branch description prune
master no
backup-new-course-panel No idea why we are saving this. yes
demo-multi-part-form-modal Demonstrates usage of custom MultiPart component along with Semantic Forms and Modals. Is somewhat outdated. no
demo-react-d3-tree Demonstrates basic usage of react-d3-tree package and nesting React components within it. no
const materials = [
'course_work',
'course_work',
'exam',
'project',
'course_work'
]

scaffold function

scaffold should be a function that takes in two inputs:

  • topicHierarchy
  • scaffoldSpec

Inputs

topicHierarchy

// E X A M P L E 1 (backend specific)
// Objection chaining, using promises
const getDog = (id) => Dog.query()
.findById(id)
const getDog = (id) => {
return Dog.query()

COURSE ROUTES

verb route body
GET courses
GET courses/:course_id
CREATE courses { name }
CREATE courses/:course_id/next-version
UPDATE courses/:course_id { name, status }
UPDATE courses/:course_id/move { new_index }
/*
For loop for iteration
without an array
*/
for (let i=0; i<10; i++) {
console.log(i)
}
// 0
function myFunction (age, name) {
arguments[0]
console.log(`my name is ${name} and my age ${age}`)
}
`
"function" is the keyword that tells JS that we are about
/*
named functions inside objects are called methods
*/
function returnAnObject(name, age) {
const myObject = {
myName: name,
myAge: age,
sleep: function() {
console.log('zzzzz')