mirror of https://github.com/MaxLeiter/Drift
				
				
				
			
							parent
							
								
									2ba613d562
								
							
						
					
					
						commit
						5df56fbdae
					
				@ -0,0 +1,25 @@
 | 
			
		||||
import { ChangeEvent, memo } from "react"
 | 
			
		||||
import { Input } from "@geist-ui/core"
 | 
			
		||||
 | 
			
		||||
import styles from "../post.module.css"
 | 
			
		||||
 | 
			
		||||
type props = {
 | 
			
		||||
	onChange: (e: ChangeEvent<HTMLInputElement>) => void
 | 
			
		||||
	description?: string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const Description = ({ onChange, description }: props) => {
 | 
			
		||||
	return (
 | 
			
		||||
		<div className={styles.description}>
 | 
			
		||||
			<Input
 | 
			
		||||
				value={description}
 | 
			
		||||
				onChange={onChange}
 | 
			
		||||
				label="Description"
 | 
			
		||||
				maxLength={256}
 | 
			
		||||
				width="100%"
 | 
			
		||||
			/>
 | 
			
		||||
		</div>
 | 
			
		||||
	)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default memo(Description)
 | 
			
		||||
@ -0,0 +1,12 @@
 | 
			
		||||
"use strict"
 | 
			
		||||
import { DataTypes } from "sequelize"
 | 
			
		||||
import type { Migration } from "../database"
 | 
			
		||||
 | 
			
		||||
export const up: Migration = async ({ context: queryInterface }) =>
 | 
			
		||||
	queryInterface.addColumn("posts", "description", {
 | 
			
		||||
		type: DataTypes.STRING,
 | 
			
		||||
		allowNull: true
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
export const down: Migration = async ({ context: queryInterface }) =>
 | 
			
		||||
	await queryInterface.removeColumn("posts", "description")
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue