Skip to content

Commit

Permalink
Merge pull request ScriptStud-io#54 from Cmosley/main
Browse files Browse the repository at this point in the history
code cleanup
  • Loading branch information
Christian Mosley committed Apr 23, 2021
2 parents 5847214 + ae882bb commit a7fbf21
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 77 deletions.
52 changes: 0 additions & 52 deletions src/components/BreadCrumbs/BreadCrumbs.jsx

This file was deleted.

8 changes: 1 addition & 7 deletions src/components/CreateSnippetForm/CreateSnippetForm.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import './CreateSnippetForm.css';
import React, { useState, useEffect, useRef } from 'react';
import { Link, useHistory } from 'react-router-dom'
import { useHistory } from 'react-router-dom'
import { useForm } from '../../hooks/useForm'
import * as snippetAPI from '../../services/snippets-api'
import CodeEditor from '../CodeEditor/CodeEditor'
import SyntaxHighlighter from '../SyntaxHighlighter/SyntaxHighlighter'

// * 3rd Iteration of Create Snippet Form, 4/20/21, Christian Mosley
// TODO: update tag input(s) with parsing functionality
// TODO: add form validation warning for invalid form
// TODO: fix create button disable state on form invalidity


Expand Down Expand Up @@ -164,15 +162,11 @@ export default function CreateSnippetForm(props){
</div>
</div>
<div className="flex justify-center mb-6">
{/* <Link
to='/search/all'
> */}
<button
type="submit"
disabled={formInvalid}
className="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
>CREATE SNIPPET</button>
{/* </Link> */}
</div>
</div>
</form>
Expand Down
1 change: 0 additions & 1 deletion src/components/PageHeader/PageHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const navigation = [
{ name: 'Home', href: '/', current: false, loggedIn: [true]},
{ name: '+ Create', href: '/snippets/create', current: false, loggedIn: [true]},
{ name: 'Search Snips', href: '/search/all', current: false, loggedIn: [true, false] },
{ name: 'About', href: '/about', current: false, loggedIn: [false]},
{ name: 'Login', href: '/login', current: false, loggedIn: [false] },
{ name: 'Sign Up', href: '/signup', current: false, loggedIn: [false] },
]
Expand Down
1 change: 0 additions & 1 deletion src/components/Snippet/Snippet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import SnippetToolBar from "../SnippetToolBar/SnippetToolBar"
import { ArrowLeftIcon } from '@heroicons/react/solid'

function Snippet(props) {
console.log('Snippet-Props', props)
let history = useHistory();
const goBack = () => history.goBack();

Expand Down
2 changes: 1 addition & 1 deletion src/components/SnippetPreview/SnippetPreview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function SnippetPreview(props) {

const createdAt = new Date(props.snippet.createdAt).toDateString();
const updatedAt = new Date(props.snippet.updatedAt).toDateString();

const titleText = props.snippet.title.length < 40 ? props.snippet.title : props.snippet.title.substring(0,39) + '...';
const previewText = props.snippet.purpose.length < 120 ? props.snippet.purpose : props.snippet.purpose.substring(0,119) + '...';
const viewLinkUrl = `/snip/${props.snippet._id}`;
Expand All @@ -16,7 +17,6 @@ function SnippetPreview(props) {
<Link to={viewLinkUrl}>
<div className='snip-preview-logo flex justify-center items-center '><FolderOpenIcon className="h-16 w-16 absolute" aria-hidden="true"/><div className="mt-16">VIEW</div></div></Link>
<div className='snip-preview-content'>

<div className='snip-preview-title'>{titleText}</div>
<div className="h-2/4">{previewText}</div>
<div className="snip-preview-bottom">Created by: {props.snippet.addedBy.name} | Created on: {createdAt} | Last Edited: {updatedAt}</div>
Expand Down
15 changes: 0 additions & 15 deletions src/hooks/useCodeEditor.js

This file was deleted.

0 comments on commit a7fbf21

Please sign in to comment.