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 styled from "styled-components" | |
import type { KnownTarget } from "styled-components/dist/types" | |
import { type BlocksContent, BlocksRenderer } from "@strapi/blocks-react-renderer" | |
type FilterAs = { | |
filteredText: string | |
as?: KnownTarget | |
} | |
const filterAs = (text: string): FilterAs => { |
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
/* essential styles for hook to work */ | |
header { | |
/* | |
this is set in the JS so the the primary behavior isn't dependant on the stylesheet | |
position: sticky; | |
top: -1px; | |
*/ | |
} | |
/* styles for when header is stuck */ |
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
export async function generateMetadata({ searchParams }: ThoughtsProps): Promise<Metadata> { | |
const tagId = searchParams?.tag ?? null | |
const [tagData, indexData] = await Promise.all([ | |
getStrapiData(`tags?${tagIdQuery(tagId)}`), | |
getStrapiData("thoughts-index?populate=*"), | |
]) | |
let tagName = tagData?.data[0]?.name ?? null | |
tagName = tagName ? `on ${tagName}` : undefined |
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 styled from "styled-components" | |
import { media, size } from "./utils" | |
enum Z { | |
Separator, | |
FauxLine, | |
FauxLineBlocker, | |
Marker, | |
} |
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
type ConditionalWrap<T> = { | |
children: React.ReactNode | |
condition: boolean | |
Wrap: T | |
wrapProps?: T extends React.ComponentType<infer P> ? P : object | |
} | |
const ConditionalWrap = <T extends React.ElementType>({ | |
children, | |
condition, |
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 { HTMLProps } from "react" | |
import styled from "styled-components" | |
import { | |
calcBasis, | |
mapGap, | |
mapJustify, | |
mapPadding, | |
media, | |
} from "./utils" |
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 styled from "styled-components" | |
import type { Sizes } from "./styles" | |
import { mapGap, mapGrow, media, size } from "./utils" | |
const BIG = "big" | |
const NONE = "none" | |
const NORMAL = "normal" | |
const DEFAULT_SIZE = NORMAL |
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 from 'react'; | |
class Icon extends React.Component { | |
render() { | |
const icons = { | |
menu: <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"> | |
<line x1="3" y1="12" x2="21" y2="12"/> | |
<line x1="3" y1="6" x2="21" y2="6"/> | |
<line x1="3" y1="18" x2="21" y2="18"/> | |
</svg>, |
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
/** | |
* Order Events by date and skip them completely if they are past | |
*/ | |
function coh_event_post_order( $query ) { | |
// do not modify queries in the admin | |
if( is_admin() ) { | |
return $query; | |
} | |
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 $toggle = $( '[data-toggle]' ); | |
function toggleOpen(event) { | |
var $this = $( this ), | |
object = $this.data( 'toggle' ), | |
$object = $( '.' + object ), // the object we're toggling | |
rel = $this.attr( 'rel' ), // the name of any related toggles | |
$other = $toggle.filter( '[rel=' + rel + ']' ).not( $this ), // find another toggle with the same rel |
NewerOlder