This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="page-width"> | |
<div class="grid"> | |
<div class="grid__item medium-up--five-sixths medium-up--push-one-twelfth"> | |
<div class="section-header text-center"> | |
<h1>{{ page.title }}</h1> | |
</div> | |
<div class="rte"> | |
{{ page.content }} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var renderFunctions = [ | |
function(item, rowIndex, offset){return offset + rowIndex + 1;}, | |
function(item){ | |
return <a target="_blank" href={item.a}>{item.b}</a> | |
}, | |
function(item){return item.c} | |
]; | |
var tableHeaders = ["S.No", "Header 1", "Header 2"]; | |
var items = [{a: "X", b: "Y", c: "Z"}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import 'Table.css'; | |
import { Card, Stack, Pagination, SkeletonDisplayText} from '@shopify/polaris'; | |
export default class GeneralisedTable extends Component { | |
static propTypes = { | |
tableHeaders: PropTypes.array.isRequired, // array of header labels. Should be an array of strings | |
attributeRenderFunctions: PropTypes.array.isRequired, // array of render functions. function accepts an item from tableData, index of the item in the current page and the active offset (if pagination is enabled) as param and returns markup for that row | |
tableData: PropTypes.array.isRequired, // the actual data array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import PropTypes from 'prop-types' | |
import {Button, ColorPicker, TextField, Popover} from '@shopify/polaris'; | |
import {hsbToHex, rgbToHsb} from '@shopify/polaris'; | |
// interchange will always be hex | |
export default class HexColorPicker extends Component { | |
static propTypes = { | |
color: PropTypes.string, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; SOLUTION 1 | |
(defn change-title-if-not-in-ignore-list [book changed-title ignore-list] | |
(let [in-ignore-list (some #(= (:serial-no book) %) ignore-list)] | |
(if (not in-ignore-list) | |
(assoc book :title changed-title) | |
book))) | |
(defn change-title [books changed-title ignore-list] | |
(let [books-vec (:books books)] | |
(->> |