file icon fixes

This commit is contained in:
Jamie
2022-01-01 20:32:12 -08:00
parent e0c4d4252b
commit ee49b35cce
6 changed files with 42 additions and 22 deletions

View File

@@ -12,23 +12,46 @@ interface Props extends DefaultProps {
}
export default function FileItem(props: Props) {
return (
<div onClick={props.onClick} className="inline-block w-[100px] mb-3">
const Shadow = () => {
return (
<div
className={clsx(
'inline-block border-2 border-transparent rounded-lg text-center w-[100px] h-[100px] ',
{ ' bg-gray-550': props.selected }
'absolute opacity-100 transition-opacity duration-200 top-auto bottom-auto w-[64px] h-[40px] shadow-xl shadow-red-500',
{ 'opacity-100': props.selected }
)}
/>
);
};
return (
<div onClick={props.onClick} className="inline-block w-[100px] mb-3">
<div
className={clsx(
'border-2 border-transparent rounded-lg text-center w-[100px] h-[100px] mb-1',
{
'bg-gray-50 dark:bg-gray-550': props.selected
}
)}
>
{/* <Shadow /> */}
{/* <div className="w-[65px] border border-gray-600 m-auto rounded-md h-[80px] bg-gray-650 relative shadow-md "> */}
{props.folder ? (
<div className="w-full h-full">
<img className="bottom-0 p-3 pt-[19px] margin-auto" src="svg/folder.svg" />
<div className="relative w-full h-full ">
<img
className="bottom-0 p-3 pt-[19px] active:translate-y-[1px] margin-auto z-90"
src="svg/folder.svg"
/>
</div>
) : (
<div className="w-[64px] mt-1.5 m-auto rounded-lg h-[80px] relative">
<div
className={clsx(
'w-[64px] mt-1.5 m-auto transition duration-200 rounded-lg h-[90px] relative active:translate-y-[1px]',
{
'': props.selected
}
)}
>
<svg
className="absolute top-0 left-0 fill-gray-750"
className="absolute top-0 left-0 fill-gray-150 dark:fill-gray-750"
width="65"
height="81"
viewBox="0 0 65 81"
@@ -38,7 +61,7 @@ export default function FileItem(props: Props) {
<svg
width="22"
height="22"
className="absolute -right-[1px] z-10 fill-gray-500"
className="absolute -right-[1px] z-10 fill-gray-50 dark:fill-gray-600"
viewBox="0 0 41 41"
>
<path d="M41.4116 40.5577H11.234C5.02962 40.5577 0 35.5281 0 29.3238V0L41.4116 40.5577Z" />

View File

@@ -82,7 +82,7 @@ export const Sidebar: React.FC<SidebarProps> = (props) => {
dark:!bg-gray-550
dark:hover:!bg-gray-550
dark:!border-gray-500
dark:!border-gray-550
dark:hover:!border-gray-500`,
variant: 'gray'
}}

View File

@@ -56,7 +56,7 @@ export const TopBar: React.FC<TopBarProps> = (props) => {
<>
<div
data-tauri-drag-region
className="flex h-[2.95rem] -mt-0.5 max-w z-50 pl-3 rounded-tr-2xl items-center border-b bg-gray-50 dark:bg-gray-600 border-gray-100 dark:border-gray-700 !bg-opacity-100 backdrop-blur"
className="flex h-[2.95rem] -mt-0.5 max-w z-50 pl-3 rounded-tr-2xl items-center border-b bg-gray-50 dark:bg-gray-600 border-gray-100 dark:border-gray-800 !bg-opacity-100 backdrop-blur"
>
<div className="">
<TopBarButton icon={ChevronLeftIcon} onClick={goBack} />

View File

@@ -45,7 +45,7 @@ export const OverviewScreen: React.FC<{}> = (props) => {
<FileItem
selected={selectedFile == 'tsx'}
onClick={() => handleSelect('tsx')}
fileName="hello.tsx"
fileName="App.tsx"
format="tsx"
iconName="reactts"
/>
@@ -59,7 +59,7 @@ export const OverviewScreen: React.FC<{}> = (props) => {
<FileItem
selected={selectedFile == 'pug'}
onClick={() => handleSelect('pug')}
fileName="yes.pug"
fileName="cool.pug"
format="pug"
iconName="pug"
/>
@@ -110,6 +110,12 @@ export const OverviewScreen: React.FC<{}> = (props) => {
fileName=".vscode"
folder
/>
<FileItem
selected={selectedFile == 'tsx3d'}
onClick={() => handleSelect('tsx3d')}
fileName="node_modules"
folder
/>
</div>
</div>
);

View File

@@ -22,11 +22,6 @@ struct DotSpaceDrive {
location_id: u32,
}
pub async fn discover_root_location() {
let mounts = get_mounts();
println!("mounts: {:?}", mounts);
}
pub async fn get_location_and_paths(
location_id: u32,
) -> Result<(locations::Model, Vec<location_paths::Model>)> {

View File

@@ -13,8 +13,6 @@ pub mod native;
pub mod util;
use futures::executor::block_on;
use crate::file::locations::discover_root_location;
// static configuration
#[derive(Serialize, Deserialize, Debug)]
pub struct CoreConfig {
@@ -86,8 +84,6 @@ pub fn configure(mut data_dir: std::path::PathBuf) -> mpsc::Receiver<ClientEvent
block_on(file::init::init_library()).expect("failed to init library");
block_on(file::client::init_client()).expect("failed to init client");
block_on(discover_root_location());
println!("Spacedrive daemon online");
// env_logger::builder()