Coder Social home page Coder Social logo

codevallyreacttest's Introduction

#How to implement this The obvious answer is Through Recursion because it makes our lives worthwhile

the base case should be -------> SHOW A FILE

the Recusive case should be ---> SHOW FOLDERS & if there is a children call the recursive function again

##GLOBAL STATES

#CURRENT_FILE STATE the current file state should be used to highlight the currentfile

#PATH

path is a global string which stores a path when a folder or file gets clicked

WHEN A FOLDER GETS CLICKED

when a folder gets clicked and it is open it shows its path with name (path is path and name is the folder's name)

##COMPONENTS

#TREE

This is the top level component which calls the recursive case.

#FILE

file is just a simple component to show the files.

#FOLDER

but folder is tricky since we also have to show the nested folders and files when it gets clicked.

#PROPERTIES (properties of a file)

the properties are name, [string] type [folder or file] childrens [ array with objects inside (files and folders)]


WHEN A FOLDER IS CLICKED

when a folder gets clicked we would implement the collapsible component which renders all the children of the folder which maybe files or folders.

##SEARCH_METHOD

#RECURSIVELY GETTING ALL THE FILES AND STORING IT FOR SEARCH we should recusively get all the files and then store it in a global variable to use ".map" method to search and and output the data and when clicked we should set the current path to its path and current file

##COLLAPSE ALL (I didnt add it but it is an idea)

i didnt do the "open " property of all folders but it should be added so that when a search is made and it is clicked every folder should collapse and the file would be then selected

codevallyreacttest's People

Contributors

seggsfault avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.